From 4ab61a77b7b345259de50f3ff248d139c7e87bef Mon Sep 17 00:00:00 2001 From: Robbert van der Helm Date: Tue, 22 Jun 2021 17:42:37 +0200 Subject: [PATCH] Compare to string view constant instead of string These are constexpr, so hopefully the compiler can be a bit smarter about it. --- src/common/utils.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/common/utils.cpp b/src/common/utils.cpp index 3ad01e95..842e995f 100644 --- a/src/common/utils.cpp +++ b/src/common/utils.cpp @@ -23,7 +23,7 @@ namespace bp = boost::process; namespace fs = boost::filesystem; -using namespace std::literals::string_literals; +using namespace std::literals::string_view_literals; /** * If this environment variable is set to `1`, then we won't enable the watchdog @@ -70,7 +70,7 @@ bool is_watchdog_timer_disabled() { // This is safe because we're not storing the pointer anywhere and the // environment doesn't get modified anywhere // NOLINTNEXTLINE(concurrency-mt-unsafe) - return getenv(disable_watchdog_timer_env_var) == "1"s; + return getenv(disable_watchdog_timer_env_var) == "1"sv; } bool pid_running(pid_t pid) {