From 4e9d362dfd125d227854772c069c963f402c9c77 Mon Sep 17 00:00:00 2001 From: Dominik Drexler Date: Wed, 24 Jul 2024 10:10:25 +0200 Subject: [PATCH] removed useless bitset set_all operation --- .../flatmemory/details/byte_buffer_segmented.hpp | 1 + include/flatmemory/details/types/bitset.hpp | 13 ------------- 2 files changed, 1 insertion(+), 13 deletions(-) diff --git a/include/flatmemory/details/byte_buffer_segmented.hpp b/include/flatmemory/details/byte_buffer_segmented.hpp index aa00100..f6eedcb 100644 --- a/include/flatmemory/details/byte_buffer_segmented.hpp +++ b/include/flatmemory/details/byte_buffer_segmented.hpp @@ -57,6 +57,7 @@ class ByteBufferSegmented // Use doubling strategy to make future insertions cheaper. m_num_bytes_per_segment = std::min(2 * m_num_bytes_per_segment, m_maximum_num_bytes_per_segment); + m_segments.push_back(std::vector(m_num_bytes_per_segment)); m_capacity += m_num_bytes_per_segment; m_cur_segment_pos = 0; diff --git a/include/flatmemory/details/types/bitset.hpp b/include/flatmemory/details/types/bitset.hpp index eef65d9..48fb88f 100644 --- a/include/flatmemory/details/types/bitset.hpp +++ b/include/flatmemory/details/types/bitset.hpp @@ -628,9 +628,6 @@ class Builder> : public IBuilder>> // Unset all bits and shrink its size to represent the bits void unset_all(); - // Set all bits and shrink its size to represent the bits - void set_all(); - Builder& operator~(); template @@ -1557,16 +1554,6 @@ void Builder>::unset_all() m_blocks.resize(1); } -template -void Builder>::set_all() -{ - assert(m_blocks.size() > 0); - - m_blocks[0] = (m_default_bit_value) ? BitsetOperator::block_zeroes : BitsetOperator::block_ones; - - m_blocks.resize(1); -} - template Builder>& Builder>::operator~() {