Closed coocood closed 2 years ago
Happy to take a patch for this.
It's caused by capacity is zero, then (capacity + segment_length - 1) / segment_length
is zero,
less than (arity - 1)
let capacity: u32 = if size > 1 {
(size as f64 * size_factor).round() as u32
} else { 0 };
let init_segment_count = (capacity + segment_length - 1) / segment_length - (arity - 1);
Any suggestion on how to fix it? Thank you.
The following code panics with message
attempt to subtract with overflow