diff options
author | HÃ¥vard Pettersen <3535158+havardpe@users.noreply.github.com> | 2022-05-12 15:24:31 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-12 15:24:31 +0200 |
commit | 2f1beb1a191580fde26e1b855a1fb7426c789e30 (patch) | |
tree | 54c8e765c757746ee134f5715b7794378ee4b904 | |
parent | 704f95e5b7592577f2d45e905666e073646bcfaf (diff) | |
parent | 84b97eda3f83dcbed2a3f9bc51415b4547789810 (diff) |
Merge pull request #22559 from vespa-engine/havardpe/remove-bitvector-swap-function
remove bitvector swap function
3 files changed, 0 insertions, 39 deletions
diff --git a/searchlib/src/vespa/searchlib/common/allocatedbitvector.cpp b/searchlib/src/vespa/searchlib/common/allocatedbitvector.cpp index f37968c70a0..33f044845aa 100644 --- a/searchlib/src/vespa/searchlib/common/allocatedbitvector.cpp +++ b/searchlib/src/vespa/searchlib/common/allocatedbitvector.cpp @@ -108,23 +108,4 @@ AllocatedBitVector::resize(Index newLength) clear(); } -AllocatedBitVector & -AllocatedBitVector::operator=(const AllocatedBitVector & rhs) -{ - AllocatedBitVector tmp(rhs); - swap(tmp); - assert(testBit(size())); - - return *this; -} -AllocatedBitVector & -AllocatedBitVector::operator=(const BitVector & rhs) -{ - AllocatedBitVector tmp(rhs); - swap(tmp); - assert(testBit(size())); - - return *this; -} - } // namespace search diff --git a/searchlib/src/vespa/searchlib/common/allocatedbitvector.h b/searchlib/src/vespa/searchlib/common/allocatedbitvector.h index 5106717dad0..a47082dc413 100644 --- a/searchlib/src/vespa/searchlib/common/allocatedbitvector.h +++ b/searchlib/src/vespa/searchlib/common/allocatedbitvector.h @@ -41,8 +41,6 @@ public: AllocatedBitVector(const BitVector &other); AllocatedBitVector(const AllocatedBitVector &other); ~AllocatedBitVector() override; - AllocatedBitVector &operator=(const AllocatedBitVector &other); - AllocatedBitVector &operator=(const BitVector &other); /** * Query the size of the bit vector. @@ -67,14 +65,8 @@ protected: private: friend class BitVectorTest; friend class GrowableBitVector; - void swap(AllocatedBitVector & rhs) { - std::swap(_capacityBits, rhs._capacityBits); - _alloc.swap(rhs._alloc); - BitVector::swap(rhs); - } AllocatedBitVector(const BitVector &other, std::pair<Index, Index> size_capacity); }; } // namespace search - diff --git a/searchlib/src/vespa/searchlib/common/bitvector.h b/searchlib/src/vespa/searchlib/common/bitvector.h index dfc3d0b280a..3f11e2a257e 100644 --- a/searchlib/src/vespa/searchlib/common/bitvector.h +++ b/searchlib/src/vespa/searchlib/common/bitvector.h @@ -207,17 +207,6 @@ public: _numTrueBits.store(invalidCount(), std::memory_order_relaxed); } - void swap(BitVector & rhs) { - auto my_words = _words; - vespalib::atomic::store_ref_release(_words, rhs._words); - vespalib::atomic::store_ref_release(rhs._words, my_words); - std::swap(_startOffset, rhs._startOffset); - std::swap(_sz, rhs._sz); - Index tmp = rhs._numTrueBits; - rhs._numTrueBits = _numTrueBits.load(std::memory_order_relaxed); - _numTrueBits.store(tmp, std::memory_order_relaxed); - } - /** * Count bits in partial bitvector [..>. * @@ -393,4 +382,3 @@ void BitVector::andNotWithT(T it) { } } // namespace search - |