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/Workspace.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/helpers/Workspace.cpp') diff --git a/src/helpers/Workspace.cpp b/src/helpers/Workspace.cpp index 51d29e5e..3264b27f 100644 --- a/src/helpers/Workspace.cpp +++ b/src/helpers/Workspace.cpp @@ -40,7 +40,7 @@ CWorkspace::~CWorkspace() { void CWorkspace::startAnim(bool in, bool left, bool instant) { const auto ANIMSTYLE = m_fAlpha.m_pConfig->pValues->internalStyle; - if (ANIMSTYLE.find("slidefade") == 0) { + if (ANIMSTYLE.starts_with("slidefade")) { const auto PMONITOR = g_pCompositor->getMonitorFromID(m_iMonitorID); float movePerc = 100.f; @@ -54,7 +54,7 @@ void CWorkspace::startAnim(bool in, bool left, bool instant) { m_fAlpha.setValueAndWarp(1.f); m_vRenderOffset.setValueAndWarp(Vector2D(0, 0)); - if (ANIMSTYLE.find("slidefadevert") == 0) { + if (ANIMSTYLE.starts_with("slidefadevert")) { if (in) { m_fAlpha.setValueAndWarp(0.f); m_vRenderOffset.setValueAndWarp(Vector2D(0, (left ? PMONITOR->vecSize.y : -PMONITOR->vecSize.y) * (movePerc / 100.f))); -- cgit v1.2.3