Skip to content

Commit

Permalink
Merge pull request #59 from aleon1138/master
Browse files Browse the repository at this point in the history
Fixed bug with power-of-two calculation
  • Loading branch information
jdonszelmann authored Jul 28, 2022
2 parents 3714f98 + 6566a71 commit ac6819a
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 ac6819a

Please sign in to comment.