From 12db0a3753d864b2e274de9a311eff8561b1ca68 Mon Sep 17 00:00:00 2001 From: "Scott E. Graves" Date: Thu, 19 Dec 2024 13:34:57 -0600 Subject: [PATCH] fix --- repertory/librepertory/include/types/repertory.hpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/repertory/librepertory/include/types/repertory.hpp b/repertory/librepertory/include/types/repertory.hpp index d971bd65..0d008ac4 100644 --- a/repertory/librepertory/include/types/repertory.hpp +++ b/repertory/librepertory/include/types/repertory.hpp @@ -56,11 +56,12 @@ public: auto operator=(atomic &&) -> atomic & = default; auto operator=(const data_t &data) -> atomic & { - mutex_lock lock(*mtx_); - if (&data != &data_) { - data_ = data; + if (&data == &data_) { + return *this; } + mutex_lock lock(*mtx_); + data_ = data; return *this; }