summaryrefslogtreecommitdiff
path: root/src/helpers/MiscFunctions.cpp
diff options
context:
space:
mode:
authorVaxry <43317083+vaxerski@users.noreply.github.com>2022-09-26 20:49:56 +0100
committerGitHub <noreply@github.com>2022-09-26 20:49:56 +0100
commit7a775c0584db95af25bae1c07952c99c6c1bfe6e (patch)
treeb72b7df6c61f380811668416366d8133116d9129 /src/helpers/MiscFunctions.cpp
parentf70b57f360f8117ecca67d6d7f75c1f87b098794 (diff)
parent87afc8c250ba6868c2374ad2a3e0a9374e8f0c1a (diff)
Merge pull request #737 from Dickby/use_max_instead_of_clamp_in_some_places
Replace clamp with max if there is no upper bound.
Diffstat (limited to 'src/helpers/MiscFunctions.cpp')
-rw-r--r--src/helpers/MiscFunctions.cpp4
1 files changed, 2 insertions, 2 deletions
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;