From 87afc8c250ba6868c2374ad2a3e0a9374e8f0c1a Mon Sep 17 00:00:00 2001 From: Felix Dick Date: Mon, 26 Sep 2022 21:10:24 +0200 Subject: Replace clamp with max if there is no upper bound. --- src/helpers/MiscFunctions.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/helpers/MiscFunctions.cpp') diff --git a/src/helpers/MiscFunctions.cpp b/src/helpers/MiscFunctions.cpp index e699d75a..d7df7bd7 100644 --- a/src/helpers/MiscFunctions.cpp +++ b/src/helpers/MiscFunctions.cpp @@ -254,9 +254,9 @@ int getWorkspaceIDFromString(const std::string& in, std::string& outName) { } else { if (g_pCompositor->m_pLastMonitor) - result = std::clamp((int)getPlusMinusKeywordResult(in, g_pCompositor->m_pLastMonitor->activeWorkspace), 1, INT_MAX); + result = std::max((int)getPlusMinusKeywordResult(in, g_pCompositor->m_pLastMonitor->activeWorkspace), 1); else if (isNumber(in)) - result = std::clamp(std::stoi(in), 1, INT_MAX); + result = std::max(std::stoi(in), 1); else { Debug::log(ERR, "Relative workspace on no mon!"); result = INT_MAX; -- cgit v1.2.3