File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -211,7 +211,7 @@ static inline bool binary_fuse8_allocate(uint32_t size,
211211 filter -> SegmentLength = 262144 ;
212212 }
213213 filter -> SegmentLengthMask = filter -> SegmentLength - 1 ;
214- double sizeFactor = binary_fuse_calculate_size_factor (arity , size );
214+ double sizeFactor = size <= 1 ? 0 : binary_fuse_calculate_size_factor (arity , size );
215215 uint32_t capacity = size <= 1 ? 0 : (uint32_t )(round ((double )size * sizeFactor ));
216216 uint32_t initSegmentCount =
217217 (capacity + filter -> SegmentLength - 1 ) / filter -> SegmentLength -
@@ -499,7 +499,7 @@ static inline bool binary_fuse16_allocate(uint32_t size,
499499 }
500500 filter -> SegmentLengthMask = filter -> SegmentLength - 1 ;
501501 double sizeFactor = size <= 1 ? 0 : binary_fuse_calculate_size_factor (arity , size );
502- uint32_t capacity = (uint32_t )(round ((double )size * sizeFactor ));
502+ uint32_t capacity = size <= 1 ? 0 : (uint32_t )(round ((double )size * sizeFactor ));
503503 uint32_t initSegmentCount =
504504 (capacity + filter -> SegmentLength - 1 ) / filter -> SegmentLength -
505505 (arity - 1 );
You can’t perform that action at this time.
0 commit comments