diff options
| author | Kamikadze <40305144+Kam1k4dze@users.noreply.github.com> | 2025-05-30 18:25:59 +0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-05-30 14:25:59 +0100 |
| commit | 9190443d951c21ab24201d033accf90b4d172f46 (patch) | |
| tree | 28a5e4a1fa9c7424733ac7065a71cead7e141b6f /src/protocols/DataDeviceWlr.cpp | |
| parent | 9bf1b491440eac6f9c0d6853013ad5666c12d1d9 (diff) | |
refactor: use std::ranges whenever possible (#10584)
Diffstat (limited to 'src/protocols/DataDeviceWlr.cpp')
| -rw-r--r-- | src/protocols/DataDeviceWlr.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/protocols/DataDeviceWlr.cpp b/src/protocols/DataDeviceWlr.cpp index 2e9c032b..e169f666 100644 --- a/src/protocols/DataDeviceWlr.cpp +++ b/src/protocols/DataDeviceWlr.cpp @@ -78,7 +78,7 @@ std::vector<std::string> CWLRDataSource::mimes() { } void CWLRDataSource::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: CWLRDataSource::sendAskSend with non-existent mime"); return; } @@ -87,7 +87,7 @@ void CWLRDataSource::send(const std::string& mime, CFileDescriptor fd) { } void CWLRDataSource::accepted(const std::string& mime) { - 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: CWLRDataSource::sendAccepted with non-existent mime"); // wlr has no accepted @@ -315,7 +315,7 @@ void CDataDeviceWLRProtocol::setSelection(SP<IDataSource> source, bool primary) } SP<CWLRDataDevice> CDataDeviceWLRProtocol::dataDeviceForClient(wl_client* c) { - 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; |
