refactor: use std::ranges whenever possible (#10584)

This commit is contained in:
Kamikadze 2025-05-30 18:25:59 +05:00 committed by GitHub
parent 9bf1b49144
commit 9190443d95
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
50 changed files with 137 additions and 146 deletions

View file

@ -36,7 +36,7 @@ bool CFocusGrab::good() {
}
bool CFocusGrab::isSurfaceComitted(SP<CWLSurfaceResource> surface) {
auto iter = std::find_if(m_surfaces.begin(), m_surfaces.end(), [surface](const auto& o) { return o.first == surface; });
auto iter = std::ranges::find_if(m_surfaces, [surface](const auto& o) { return o.first == surface; });
if (iter == m_surfaces.end())
return false;
@ -70,7 +70,7 @@ void CFocusGrab::finish(bool sendCleared) {
}
void CFocusGrab::addSurface(SP<CWLSurfaceResource> surface) {
auto iter = std::find_if(m_surfaces.begin(), m_surfaces.end(), [surface](const auto& e) { return e.first == surface; });
auto iter = std::ranges::find_if(m_surfaces, [surface](const auto& e) { return e.first == surface; });
if (iter == m_surfaces.end())
m_surfaces.emplace(surface, makeUnique<CFocusGrabSurfaceState>(this, surface));
}