From 8d6c18076f3268a6c85c6085d29f898267028101 Mon Sep 17 00:00:00 2001 From: Tom Englund Date: Mon, 26 Aug 2024 17:25:39 +0200 Subject: core: make most for loops use const references (#7527) why not let the compiler optimise things for us at hyprspeeds when we can. --- src/protocols/core/DataDevice.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/protocols/core/DataDevice.cpp') diff --git a/src/protocols/core/DataDevice.cpp b/src/protocols/core/DataDevice.cpp index 4ed28f24..943c790f 100644 --- a/src/protocols/core/DataDevice.cpp +++ b/src/protocols/core/DataDevice.cpp @@ -306,7 +306,7 @@ CWLDataDeviceManagerResource::CWLDataDeviceManagerResource(SPself = RESOURCE; - for (auto& s : sources) { + for (auto const& s : sources) { if (!s) continue; s->device = RESOURCE; @@ -390,7 +390,7 @@ void CWLDataDeviceProtocol::onDestroyDataSource(WP source } void CWLDataDeviceProtocol::setSelection(SP source) { - for (auto& o : m_vOffers) { + for (auto const& o : m_vOffers) { if (o->source && o->source->hasDnd()) continue; o->dead = true; @@ -439,7 +439,7 @@ void CWLDataDeviceProtocol::updateSelection() { } void CWLDataDeviceProtocol::onKeyboardFocus() { - for (auto& o : m_vOffers) { + for (auto const& o : m_vOffers) { o->dead = true; } @@ -606,7 +606,7 @@ bool CWLDataDeviceProtocol::wasDragSuccessful() { if (!dnd.focusedDevice || !dnd.currentSource) return false; - for (auto& o : m_vOffers) { + for (auto const& o : m_vOffers) { if (o->dead || !o->source || !o->source->hasDnd()) continue; -- cgit v1.2.3