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
|
|
@ -31,7 +31,7 @@ void CInputManager::newIdleInhibitor(std::any inhibitor) {
|
|||
|
||||
void CInputManager::recheckIdleInhibitorStatus() {
|
||||
|
||||
for (auto& ii : m_vIdleInhibitors) {
|
||||
for (auto const& ii : m_vIdleInhibitors) {
|
||||
if (ii->nonDesktop) {
|
||||
PROTO::idle->setInhibit(true);
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -919,7 +919,7 @@ void CInputManager::setupKeyboard(SP<IKeyboard> keeb) {
|
|||
}
|
||||
|
||||
void CInputManager::setKeyboardLayout() {
|
||||
for (auto& k : m_vKeyboards)
|
||||
for (auto const& k : m_vKeyboards)
|
||||
applyConfigToKeyboard(k);
|
||||
|
||||
g_pKeybindManager->updateXKBTranslationState();
|
||||
|
|
@ -1197,7 +1197,7 @@ void CInputManager::destroyKeyboard(SP<IKeyboard> pKeyboard) {
|
|||
|
||||
if (m_vKeyboards.size() > 0) {
|
||||
bool found = false;
|
||||
for (auto& k : m_vKeyboards | std::views::reverse) {
|
||||
for (auto const& k : m_vKeyboards | std::views::reverse) {
|
||||
if (!k)
|
||||
continue;
|
||||
|
||||
|
|
@ -1673,7 +1673,7 @@ void CInputManager::releaseAllMouseButtons() {
|
|||
if (PROTO::data->dndActive())
|
||||
return;
|
||||
|
||||
for (auto& mb : buttonsCopy) {
|
||||
for (auto const& mb : buttonsCopy) {
|
||||
g_pSeatManager->sendPointerButton(0, mb, WL_POINTER_BUTTON_STATE_RELEASED);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ void CInputManager::onSwipeBegin(IPointer::SSwipeBeginEvent e) {
|
|||
return;
|
||||
|
||||
int onMonitor = 0;
|
||||
for (auto& w : g_pCompositor->m_vWorkspaces) {
|
||||
for (auto const& w : g_pCompositor->m_vWorkspaces) {
|
||||
if (w->m_iMonitorID == g_pCompositor->m_pLastMonitor->ID && !g_pCompositor->isWorkspaceSpecial(w->m_iID)) {
|
||||
onMonitor++;
|
||||
}
|
||||
|
|
@ -38,7 +38,7 @@ void CInputManager::beginWorkspaceSwipe() {
|
|||
m_sActiveSwipe.speedPoints = 0;
|
||||
|
||||
if (PWORKSPACE->m_bHasFullscreenWindow) {
|
||||
for (auto& ls : g_pCompositor->m_pLastMonitor->m_aLayerSurfaceLayers[2]) {
|
||||
for (auto const& ls : g_pCompositor->m_pLastMonitor->m_aLayerSurfaceLayers[2]) {
|
||||
ls->alpha = 1.f;
|
||||
}
|
||||
}
|
||||
|
|
@ -193,7 +193,7 @@ void CInputManager::endWorkspaceSwipe() {
|
|||
g_pInputManager->refocus();
|
||||
|
||||
// apply alpha
|
||||
for (auto& ls : g_pCompositor->m_pLastMonitor->m_aLayerSurfaceLayers[2]) {
|
||||
for (auto const& ls : g_pCompositor->m_pLastMonitor->m_aLayerSurfaceLayers[2]) {
|
||||
ls->alpha = pSwitchedTo->m_bHasFullscreenWindow && pSwitchedTo->m_efFullscreenMode == FSMODE_FULLSCREEN ? 0.f : 1.f;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ static void unfocusTool(SP<CTabletTool> tool) {
|
|||
tool->setSurface(nullptr);
|
||||
if (tool->isDown)
|
||||
PROTO::tablet->up(tool);
|
||||
for (auto& b : tool->buttonsDown) {
|
||||
for (auto const& b : tool->buttonsDown) {
|
||||
PROTO::tablet->buttonTool(tool, b, false);
|
||||
}
|
||||
PROTO::tablet->proximityOut(tool);
|
||||
|
|
@ -31,7 +31,7 @@ static void focusTool(SP<CTabletTool> tool, SP<CTablet> tablet, SP<CWLSurfaceRes
|
|||
PROTO::tablet->proximityIn(tool, tablet, surf);
|
||||
if (tool->isDown)
|
||||
PROTO::tablet->down(tool);
|
||||
for (auto& b : tool->buttonsDown) {
|
||||
for (auto const& b : tool->buttonsDown) {
|
||||
PROTO::tablet->buttonTool(tool, b, true);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue