From 69c2b2926e128f1fd09080aed43944987a42026f Mon Sep 17 00:00:00 2001 From: Kamikadze <40305144+Kam1k4dze@users.noreply.github.com> Date: Sat, 31 May 2025 23:49:50 +0500 Subject: internal: refactor to use empty() (#10599) --- src/managers/CursorManager.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/managers/CursorManager.cpp') diff --git a/src/managers/CursorManager.cpp b/src/managers/CursorManager.cpp index 9211fc20..cb46dd65 100644 --- a/src/managers/CursorManager.cpp +++ b/src/managers/CursorManager.cpp @@ -183,7 +183,7 @@ void CCursorManager::setCursorFromName(const std::string& name) { auto setHyprCursor = [this](auto const& name) { m_currentCursorShapeData = m_hyprcursor->getShape(name.c_str(), m_currentStyleInfo); - if (m_currentCursorShapeData.images.size() < 1) { + if (m_currentCursorShapeData.images.empty()) { // try with '_' first (old hc, etc) std::string newName = name; std::ranges::replace(newName, '-', '_'); @@ -191,18 +191,18 @@ void CCursorManager::setCursorFromName(const std::string& name) { m_currentCursorShapeData = m_hyprcursor->getShape(newName.c_str(), m_currentStyleInfo); } - if (m_currentCursorShapeData.images.size() < 1) { + if (m_currentCursorShapeData.images.empty()) { // fallback to a default if available constexpr const std::array fallbackShapes = {"default", "left_ptr", "left-ptr"}; for (auto const& s : fallbackShapes) { m_currentCursorShapeData = m_hyprcursor->getShape(s, m_currentStyleInfo); - if (m_currentCursorShapeData.images.size() > 0) + if (!m_currentCursorShapeData.images.empty()) break; } - if (m_currentCursorShapeData.images.size() < 1) { + if (m_currentCursorShapeData.images.empty()) { Debug::log(ERR, "BUG THIS: No fallback found for a cursor in setCursorFromName"); return false; } -- cgit v1.2.3