From 7783ffe172f5b4b53b06f60d783fdaac2d3d32cd Mon Sep 17 00:00:00 2001 From: ajtribick Date: Sat, 6 Jul 2024 16:14:16 +0200 Subject: [PATCH] Fix BlockArray size method --- src/celutil/blockarray.h | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/celutil/blockarray.h b/src/celutil/blockarray.h index 6521527376..5471c4122f 100644 --- a/src/celutil/blockarray.h +++ b/src/celutil/blockarray.h @@ -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(std::numeric_limits::max()); }