We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1a5767d commit 7802935Copy full SHA for 7802935
1 file changed
include/osp/auxiliary/datastructures/union_find.hpp
@@ -126,7 +126,8 @@ class UnionFindUniverse {
126
127
// Reserve map to avoid rehashes
128
IndexT currentMapSize = static_cast<IndexT>(namesToIndices_.size());
129
- IndexT currentMapCapacity = static_cast<IndexT>(namesToIndices_.bucket_count() * namesToIndices_.max_load_factor());
+ IndexT currentMapCapacity
130
+ = static_cast<IndexT>(static_cast<float>(namesToIndices_.bucket_count()) * namesToIndices_.max_load_factor());
131
132
if (currentMapSize + addSize > currentMapCapacity) {
133
IndexT newMinMapCapacity = std::max((currentMapCapacity + 1) / 2 * 3, currentMapSize + addSize);
0 commit comments