From 40dd829464096ebd90762a3f8601b62e52143e28 Mon Sep 17 00:00:00 2001 From: Alan Jowett Date: Mon, 11 Nov 2024 09:33:50 -0800 Subject: [PATCH] PR feedback Signed-off-by: Alan Jowett --- src/crab_utils/stats.hpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/crab_utils/stats.hpp b/src/crab_utils/stats.hpp index 15c6f2892..d60a1c49f 100644 --- a/src/crab_utils/stats.hpp +++ b/src/crab_utils/stats.hpp @@ -48,7 +48,7 @@ class CrabStats { static unsigned get(const std::string& n); static unsigned uset(const std::string& n, unsigned v); static void count(const std::string& name) { - if (enabled) { + if constexpr (enabled) { ++(*counters)[name]; } } @@ -56,17 +56,17 @@ class CrabStats { /* stop watch */ static void start(const std::string& name) { - if (enabled) { + if constexpr (enabled) { (*sw)[name].start(); } } static void stop(const std::string& name) { - if (enabled) { + if constexpr (enabled) { (*sw)[name].stop(); } } static void resume(const std::string& name) { - if (enabled) { + if constexpr (enabled) { (*sw)[name].resume(); } }