summaryrefslogtreecommitdiff
path: root/src/helpers/WLClasses.cpp
diff options
context:
space:
mode:
authorPhilip Damianik <39028343+pdamianik@users.noreply.github.com>2023-10-15 20:07:23 +0200
committerGitHub <noreply@github.com>2023-10-15 19:07:23 +0100
commit442209942fdedbdded6362cafed736c327da0e1c (patch)
tree8e8b257bc9656f5364be9f56509b8bbdd88b1cdd /src/helpers/WLClasses.cpp
parent43b39e0bc6a83ce190ff09054beb713e0431f19b (diff)
cleanup: Replace find() with C++20 starts_with(), ends_with() and contains() (#3572)
* Replace find() with C++20 starts_with() and ends_with() * Replace find() with C++20 contains()
Diffstat (limited to 'src/helpers/WLClasses.cpp')
-rw-r--r--src/helpers/WLClasses.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/helpers/WLClasses.cpp b/src/helpers/WLClasses.cpp
index 1fa807fa..6923d6a5 100644
--- a/src/helpers/WLClasses.cpp
+++ b/src/helpers/WLClasses.cpp
@@ -20,7 +20,7 @@ void SLayerSurface::applyRules() {
noAnimations = true;
else if (rule.rule == "blur")
forceBlur = true;
- else if (rule.rule.find("ignorealpha") == 0 || rule.rule.find("ignorezero") == 0) {
+ else if (rule.rule.starts_with("ignorealpha") || rule.rule.starts_with("ignorezero")) {
const auto FIRST_SPACE_POS = rule.rule.find_first_of(' ');
std::string alphaValue = "";
if (FIRST_SPACE_POS != std::string::npos)
@@ -31,7 +31,7 @@ void SLayerSurface::applyRules() {
if (!alphaValue.empty())
ignoreAlphaValue = std::stof(alphaValue);
} catch (...) { Debug::log(ERR, "Invalid value passed to ignoreAlpha"); }
- } else if (rule.rule.find("xray") == 0) {
+ } else if (rule.rule.starts_with("xray")) {
CVarList vars{rule.rule, 0, ' '};
try {
xray = configStringToInt(vars[1]);