Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
levinli303 committed Jul 9, 2024
2 parents 024b2ae + 7783ffe commit 9beb96a
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/celutil/blockarray.h
Original file line number Diff line number Diff line change
Expand Up @@ -145,11 +145,7 @@ class BlockArray
{
if (m_blocks.empty())
return 0;
// For power-of-two sizes we can use bitwise OR instead of addition
if constexpr ((BLOCKSIZE & (BLOCKSIZE - 1)) == 0)
return ((m_blocks.size() - 1) * BLOCKSIZE) | m_blocks.back()->size();
else
return ((m_blocks.size() - 1) * BLOCKSIZE) + m_blocks.back()->size();
return ((m_blocks.size() - 1) * BLOCKSIZE) + m_blocks.back()->size();
}

size_type max_size() const noexcept { return static_cast<size_type>(std::numeric_limits<difference_type>::max()); }
Expand Down

0 comments on commit 9beb96a

Please sign in to comment.