From e34127ef881281a405e2933c98f6577bd6c35252 Mon Sep 17 00:00:00 2001 From: "Narazaki, Shuji" Date: Sat, 14 Dec 2024 09:30:50 +0900 Subject: [PATCH] Simplify code requiring some features --- src/assign/learning_rate.rs | 5 ++++- src/bin/splw.rs | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/assign/learning_rate.rs b/src/assign/learning_rate.rs index 4fea4be0f..d5f166771 100644 --- a/src/assign/learning_rate.rs +++ b/src/assign/learning_rate.rs @@ -18,13 +18,16 @@ impl ActivityIF for AssignStack { fn reward_at_analysis(&mut self, vi: VarId) { self.var[vi].turn_on(FlagVar::USED); } + #[cfg(feature = "spin")] #[inline] fn reward_at_assign(&mut self, vi: VarId) { - #[cfg(feature = "spin")] if let Some(b) = self.var[vi].assign { self.var[vi].spin.update(b, self.tick); } } + #[cfg(not(feature = "spin"))] + #[inline] + fn reward_at_assign(&mut self, _vi: VarId) {} #[inline] fn reward_at_propagation(&mut self, _vi: VarId) {} #[inline] diff --git a/src/bin/splw.rs b/src/bin/splw.rs index 49048d202..546866473 100644 --- a/src/bin/splw.rs +++ b/src/bin/splw.rs @@ -1,3 +1,4 @@ +#![cfg(feature = "graph_view")] #[allow(unused_imports)] use { crossterm::{