Skip to content

Commit

Permalink
revert unset_all for some testing
Browse files Browse the repository at this point in the history
  • Loading branch information
drexlerd committed May 25, 2024
1 parent 2c86b58 commit 516ed27
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions include/flatmemory/details/types/bitset.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1111,11 +1111,16 @@ class Builder<Bitset<Block>> : public IBuilder<Builder<Bitset<Block>>>
// Unset all bits and shrink its size to represent the bits
void unset_all()
{
assert(m_blocks.size() > 0);
// assert(m_blocks.size() > 0);

m_blocks[0] = (m_default_bit_value) ? BitsetOperator::block_ones : BitsetOperator::block_zeroes;
// m_blocks[0] = (m_default_bit_value) ? BitsetOperator::block_ones : BitsetOperator::block_zeroes;

m_blocks.resize(1);
// m_blocks.resize(1);

for (auto& value : m_blocks)
{
value = (m_default_bit_value) ? BitsetOperator::block_ones : BitsetOperator::block_zeroes;
}
}

// Set all bits and shrink its size to represent the bits
Expand Down

0 comments on commit 516ed27

Please sign in to comment.