Browse Source

Make use of is_power_of_two

master
Ivan Ukhov 9 years ago
parent
commit
7435c6153d
  1. 2
      src/lib.rs

2
src/lib.rs

@ -7,7 +7,7 @@ extern crate complex as number;
macro_rules! power_of_two(
($data:expr) => ({
let n = $data.len();
if n < 1 || n & (n - 1) != 0 {
if !n.is_power_of_two() {
panic!("expected the number of points to be a power of two");
}
n

Loading…
Cancel
Save