From 442209942fdedbdded6362cafed736c327da0e1c Mon Sep 17 00:00:00 2001 From: Philip Damianik <39028343+pdamianik@users.noreply.github.com> Date: Sun, 15 Oct 2023 20:07:23 +0200 Subject: 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() --- src/helpers/WLClasses.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/helpers/WLClasses.cpp') 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]); -- cgit v1.2.3