From 2943270bbd23e5ec53391d0e93c056e5858d0002 Mon Sep 17 00:00:00 2001 From: Simon Gardling Date: Mon, 28 Feb 2022 11:07:06 -0500 Subject: [PATCH] cleanup --- src/function.rs | 10 +++++----- src/misc.rs | 2 ++ 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/function.rs b/src/function.rs index b2ace40..b4f4961 100644 --- a/src/function.rs +++ b/src/function.rs @@ -161,7 +161,7 @@ impl Function { self.max_x = max_x; self.pixel_width = pixel_width; } else if ((min_x != self.min_x) | (max_x != self.max_x)) && self.back_cache.is_some() { - debug_log("back_cache: partial regen"); + // debug_log("back_cache: partial regen"); let range_new: f64 = max_x.abs() + min_x.abs(); let resolution: f64 = (self.pixel_width as f64 / range_new) as f64; @@ -207,11 +207,11 @@ impl Function { pub fn run(&mut self) -> FunctionOutput { let front_values: Vec = match self.back_cache.is_some() { true => { - debug_log("back_cache: using"); + // debug_log("back_cache: using"); self.back_cache.as_ref().expect("").clone() } false => { - debug_log("back_cache: regen"); + // debug_log("back_cache: regen"); let absrange = (self.max_x - self.min_x).abs(); let resolution: f64 = (self.pixel_width as f64 / absrange) as f64; let front_data: Vec = (1..=self.pixel_width) @@ -229,13 +229,13 @@ impl Function { if self.integral { let back_bars: (Vec, f64) = match self.front_cache.is_some() { true => { - debug_log("front_cache: using"); + // debug_log("front_cache: using"); let cache = self.front_cache.as_ref().expect(""); let vec_bars: Vec = cache.0.to_vec(); (vec_bars, cache.1) } false => { - debug_log("front_cache: regen"); + // debug_log("front_cache: regen"); let (data, area) = self.integral_rectangles(); let bars: Vec = data.iter().map(|(x, y)| Bar::new(*x, *y)).collect(); diff --git a/src/misc.rs b/src/misc.rs index 00094b8..1705d42 100644 --- a/src/misc.rs +++ b/src/misc.rs @@ -21,6 +21,7 @@ pub fn log_helper(s: &str) { } #[cfg(debug_assertions)] +#[allow(dead_code)] pub fn debug_log(s: &str) { #[cfg(target_arch = "wasm32")] log(s); @@ -30,6 +31,7 @@ pub fn debug_log(s: &str) { } #[cfg(not(debug_assertions))] +#[allow(dead_code)] pub fn debug_log(_s: &str) {} /*