From 8e44a7099f152b413f87acf24544e53b92e35daf Mon Sep 17 00:00:00 2001 From: TheTurtle Date: Fri, 27 Jun 2025 04:07:56 +0300 Subject: [PATCH] bit_array: Remove non const operator~ (#3161) --- src/common/bit_array.h | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/src/common/bit_array.h b/src/common/bit_array.h index f211bbf95..0ab464390 100644 --- a/src/common/bit_array.h +++ b/src/common/bit_array.h @@ -361,13 +361,6 @@ public: return *this; } - inline constexpr BitArray& operator~() { - for (size_t i = 0; i < WORD_COUNT; ++i) { - data[i] = ~data[i]; - } - return *this; - } - inline constexpr BitArray operator|(const BitArray& other) const { BitArray result = *this; result |= other; @@ -388,7 +381,9 @@ public: inline constexpr BitArray operator~() const { BitArray result = *this; - result = ~result; + for (size_t i = 0; i < WORD_COUNT; ++i) { + result.data[i] = ~result.data[i]; + } return result; } @@ -408,4 +403,4 @@ private: std::array data{}; }; -} // namespace Common \ No newline at end of file +} // namespace Common