From 7435c6153d399ab53a84e8d2f326b4bcffbc21bb Mon Sep 17 00:00:00 2001 From: Ivan Ukhov Date: Wed, 1 Jul 2015 08:07:28 -0400 Subject: [PATCH] Make use of is_power_of_two --- src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index 2a73883..7528090 100644 --- a/src/lib.rs +++ b/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