core: make most for loops use const references (#7527)
why not let the compiler optimise things for us at hyprspeeds when we can.
This commit is contained in:
parent
9c5a37a797
commit
8d6c18076f
31 changed files with 169 additions and 169 deletions
|
|
@ -306,7 +306,7 @@ CWLDataDeviceManagerResource::CWLDataDeviceManagerResource(SP<CWlDataDeviceManag
|
|||
|
||||
RESOURCE->self = RESOURCE;
|
||||
|
||||
for (auto& s : sources) {
|
||||
for (auto const& s : sources) {
|
||||
if (!s)
|
||||
continue;
|
||||
s->device = RESOURCE;
|
||||
|
|
@ -390,7 +390,7 @@ void CWLDataDeviceProtocol::onDestroyDataSource(WP<CWLDataSourceResource> source
|
|||
}
|
||||
|
||||
void CWLDataDeviceProtocol::setSelection(SP<IDataSource> 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;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue