From 9190443d951c21ab24201d033accf90b4d172f46 Mon Sep 17 00:00:00 2001 From: Kamikadze <40305144+Kam1k4dze@users.noreply.github.com> Date: Fri, 30 May 2025 18:25:59 +0500 Subject: refactor: use std::ranges whenever possible (#10584) --- src/protocols/core/DataDevice.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/protocols/core/DataDevice.cpp') diff --git a/src/protocols/core/DataDevice.cpp b/src/protocols/core/DataDevice.cpp index ad580ed1..ec075e8b 100644 --- a/src/protocols/core/DataDevice.cpp +++ b/src/protocols/core/DataDevice.cpp @@ -171,7 +171,7 @@ void CWLDataSourceResource::accepted(const std::string& mime) { return; } - if (std::find(m_mimeTypes.begin(), m_mimeTypes.end(), mime) == m_mimeTypes.end()) { + if (std::ranges::find(m_mimeTypes, mime) == m_mimeTypes.end()) { LOGM(ERR, "Compositor/App bug: CWLDataSourceResource::sendAccepted with non-existent mime"); return; } @@ -184,7 +184,7 @@ std::vector CWLDataSourceResource::mimes() { } void CWLDataSourceResource::send(const std::string& mime, CFileDescriptor fd) { - if (std::find(m_mimeTypes.begin(), m_mimeTypes.end(), mime) == m_mimeTypes.end()) { + if (std::ranges::find(m_mimeTypes, mime) == m_mimeTypes.end()) { LOGM(ERR, "Compositor/App bug: CWLDataSourceResource::sendAskSend with non-existent mime"); return; } @@ -424,7 +424,7 @@ SP CWLDataDeviceProtocol::dataDeviceForClient(wl_client* c) { return g_pXWayland->m_wm->getDataDevice(); #endif - auto it = std::find_if(m_devices.begin(), m_devices.end(), [c](const auto& e) { return e->client() == c; }); + auto it = std::ranges::find_if(m_devices, [c](const auto& e) { return e->client() == c; }); if (it == m_devices.end()) return nullptr; return *it; -- cgit v1.2.3