misc: constify the remaining for loops (#7534)
now we roll loops at blazing constified speed.
This commit is contained in:
parent
1ea47950f4
commit
72c7818ae6
79 changed files with 472 additions and 472 deletions
|
|
@ -49,7 +49,7 @@ void CInputManager::recheckIdleInhibitorStatus() {
|
|||
}
|
||||
|
||||
// check manual user-set inhibitors
|
||||
for (auto& w : g_pCompositor->m_vWindows) {
|
||||
for (auto const& w : g_pCompositor->m_vWindows) {
|
||||
if (w->m_eIdleInhibitMode == IDLEINHIBIT_NONE)
|
||||
continue;
|
||||
|
||||
|
|
|
|||
|
|
@ -1033,7 +1033,7 @@ void CInputManager::setupMouse(SP<IPointer> mauz) {
|
|||
}
|
||||
|
||||
void CInputManager::setPointerConfigs() {
|
||||
for (auto& m : m_vPointers) {
|
||||
for (auto const& m : m_vPointers) {
|
||||
auto devname = m->hlName;
|
||||
|
||||
const auto HASCONFIG = g_pConfigManager->deviceConfigExists(devname);
|
||||
|
|
@ -1268,7 +1268,7 @@ void CInputManager::updateKeyboardsLeds(SP<IKeyboard> pKeyboard) {
|
|||
if (!leds.has_value())
|
||||
return;
|
||||
|
||||
for (auto& k : m_vKeyboards) {
|
||||
for (auto const& k : m_vKeyboards) {
|
||||
k->updateLEDs(leds.value());
|
||||
}
|
||||
}
|
||||
|
|
@ -1402,7 +1402,7 @@ void CInputManager::unconstrainMouse() {
|
|||
if (g_pSeatManager->mouse.expired())
|
||||
return;
|
||||
|
||||
for (auto& c : m_vConstraints) {
|
||||
for (auto const& c : m_vConstraints) {
|
||||
const auto C = c.lock();
|
||||
|
||||
if (!C)
|
||||
|
|
@ -1416,7 +1416,7 @@ void CInputManager::unconstrainMouse() {
|
|||
}
|
||||
|
||||
bool CInputManager::isConstrained() {
|
||||
for (auto& c : m_vConstraints) {
|
||||
for (auto const& c : m_vConstraints) {
|
||||
const auto C = c.lock();
|
||||
|
||||
if (!C)
|
||||
|
|
@ -1434,7 +1434,7 @@ bool CInputManager::isConstrained() {
|
|||
void CInputManager::updateCapabilities() {
|
||||
uint32_t caps = 0;
|
||||
|
||||
for (auto& h : m_vHIDs) {
|
||||
for (auto const& h : m_vHIDs) {
|
||||
if (h.expired())
|
||||
continue;
|
||||
|
||||
|
|
@ -1449,7 +1449,7 @@ uint32_t CInputManager::accumulateModsFromAllKBs() {
|
|||
|
||||
uint32_t finalMask = 0;
|
||||
|
||||
for (auto& kb : m_vKeyboards) {
|
||||
for (auto const& kb : m_vKeyboards) {
|
||||
if (kb->isVirtual() && shouldIgnoreVirtualKeyboard(kb))
|
||||
continue;
|
||||
|
||||
|
|
@ -1464,7 +1464,7 @@ uint32_t CInputManager::accumulateModsFromAllKBs() {
|
|||
|
||||
void CInputManager::disableAllKeyboards(bool virt) {
|
||||
|
||||
for (auto& k : m_vKeyboards) {
|
||||
for (auto const& k : m_vKeyboards) {
|
||||
if (k->isVirtual() != virt)
|
||||
continue;
|
||||
|
||||
|
|
@ -1540,13 +1540,13 @@ void CInputManager::setTouchDeviceConfigs(SP<ITouch> dev) {
|
|||
return;
|
||||
}
|
||||
|
||||
for (auto& m : m_vTouches) {
|
||||
for (auto const& m : m_vTouches) {
|
||||
setConfig(m);
|
||||
}
|
||||
}
|
||||
|
||||
void CInputManager::setTabletConfigs() {
|
||||
for (auto& t : m_vTablets) {
|
||||
for (auto const& t : m_vTablets) {
|
||||
if (t->aq()->getLibinputHandle()) {
|
||||
const auto NAME = t->hlName;
|
||||
const auto LIBINPUTDEV = t->aq()->getLibinputHandle();
|
||||
|
|
@ -1711,7 +1711,7 @@ void CInputManager::setCursorIconOnBorder(PHLWINDOW w) {
|
|||
|
||||
bool onDeco = false;
|
||||
|
||||
for (auto& wd : w->m_dWindowDecorations) {
|
||||
for (auto const& wd : w->m_dWindowDecorations) {
|
||||
if (!(wd->getDecorationFlags() & DECORATION_ALLOWS_MOUSE_INPUT))
|
||||
continue;
|
||||
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ void CInputMethodRelay::onNewIME(SP<CInputMethodV2> pIME) {
|
|||
if (!g_pCompositor->m_pLastFocus)
|
||||
return;
|
||||
|
||||
for (auto& ti : m_vTextInputs) {
|
||||
for (auto const& ti : m_vTextInputs) {
|
||||
if (ti->client() != g_pCompositor->m_pLastFocus->client())
|
||||
continue;
|
||||
|
||||
|
|
@ -80,7 +80,7 @@ CTextInput* CInputMethodRelay::getFocusedTextInput() {
|
|||
if (!g_pCompositor->m_pLastFocus)
|
||||
return nullptr;
|
||||
|
||||
for (auto& ti : m_vTextInputs) {
|
||||
for (auto const& ti : m_vTextInputs) {
|
||||
if (ti->focusedSurface() == g_pCompositor->m_pLastFocus)
|
||||
return ti.get();
|
||||
}
|
||||
|
|
@ -101,7 +101,7 @@ void CInputMethodRelay::removeTextInput(CTextInput* pInput) {
|
|||
}
|
||||
|
||||
void CInputMethodRelay::updateAllPopups() {
|
||||
for (auto& p : m_vIMEPopups) {
|
||||
for (auto const& p : m_vIMEPopups) {
|
||||
p->onCommit();
|
||||
}
|
||||
}
|
||||
|
|
@ -138,7 +138,7 @@ void CInputMethodRelay::onKeyboardFocus(SP<CWLSurfaceResource> pSurface) {
|
|||
|
||||
m_pLastKbFocus = pSurface;
|
||||
|
||||
for (auto& ti : m_vTextInputs) {
|
||||
for (auto const& ti : m_vTextInputs) {
|
||||
if (!ti->focusedSurface())
|
||||
continue;
|
||||
|
||||
|
|
@ -148,7 +148,7 @@ void CInputMethodRelay::onKeyboardFocus(SP<CWLSurfaceResource> pSurface) {
|
|||
if (!pSurface)
|
||||
return;
|
||||
|
||||
for (auto& ti : m_vTextInputs) {
|
||||
for (auto const& ti : m_vTextInputs) {
|
||||
if (!ti->isV3())
|
||||
continue;
|
||||
|
||||
|
|
@ -160,7 +160,7 @@ void CInputMethodRelay::onKeyboardFocus(SP<CWLSurfaceResource> pSurface) {
|
|||
}
|
||||
|
||||
CInputPopup* CInputMethodRelay::popupFromCoords(const Vector2D& point) {
|
||||
for (auto& p : m_vIMEPopups) {
|
||||
for (auto const& p : m_vIMEPopups) {
|
||||
if (p->isVecInPopup(point))
|
||||
return p.get();
|
||||
}
|
||||
|
|
@ -169,7 +169,7 @@ CInputPopup* CInputMethodRelay::popupFromCoords(const Vector2D& point) {
|
|||
}
|
||||
|
||||
CInputPopup* CInputMethodRelay::popupFromSurface(const SP<CWLSurfaceResource> surface) {
|
||||
for (auto& p : m_vIMEPopups) {
|
||||
for (auto const& p : m_vIMEPopups) {
|
||||
if (p->getSurface() == surface)
|
||||
return p.get();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -229,7 +229,7 @@ void CInputManager::newTablet(SP<Aquamarine::ITablet> pDevice) {
|
|||
|
||||
SP<CTabletTool> CInputManager::ensureTabletToolPresent(SP<Aquamarine::ITabletTool> pTool) {
|
||||
|
||||
for (auto& t : m_vTabletTools) {
|
||||
for (auto const& t : m_vTabletTools) {
|
||||
if (t->aq() == pTool)
|
||||
return t;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue