Skip to content

Commit

Permalink
Fixed bug with power-of-two calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
aleon1138 committed Jul 14, 2022
1 parent 3714f98 commit 6566a71
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/with_alloc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ impl<T> AllocRingBuffer<T> {
/// function raised to the power of two (effectively the input is the log2 of the actual capacity)
#[inline]
pub fn with_capacity_power_of_2(cap_power_of_two: usize) -> Self {
Self::with_capacity_unchecked(cap_power_of_two.pow(2))
Self::with_capacity_unchecked(1 << cap_power_of_two)
}

#[inline]
Expand Down

0 comments on commit 6566a71

Please sign in to comment.