misc: constify the remaining for loops (#7534)

now we roll loops at blazing constified speed.
This commit is contained in:
Tom Englund
2024-08-26 20:24:30 +02:00
committed by GitHub
parent 1ea47950f4
commit 72c7818ae6
79 changed files with 472 additions and 472 deletions

View File

@@ -155,7 +155,7 @@ void CScreencopyFrame::copy(CZwlrScreencopyFrameV1* pFrame, wl_resource* buffer_
lockedSWCursors = true;
// TODO: make it per-monitor
if (!PROTO::screencopy->m_bTimerArmed) {
for (auto& m : g_pCompositor->m_vMonitors) {
for (auto const& m : g_pCompositor->m_vMonitors) {
g_pPointerManager->lockSoftwareForMonitor(m);
}
PROTO::screencopy->m_bTimerArmed = true;
@@ -365,7 +365,7 @@ CScreencopyProtocol::CScreencopyProtocol(const wl_interface* iface, const int& v
std::nullopt,
[this](SP<CEventLoopTimer> self, void* data) {
// TODO: make it per-monitor
for (auto& m : g_pCompositor->m_vMonitors) {
for (auto const& m : g_pCompositor->m_vMonitors) {
g_pPointerManager->unlockSoftwareForMonitor(m);
}
m_bTimerArmed = false;
@@ -411,7 +411,7 @@ void CScreencopyProtocol::onOutputCommit(CMonitor* pMonitor) {
std::vector<WP<CScreencopyFrame>> framesToRemove;
// share frame if correct output
for (auto& f : m_vFramesAwaitingWrite) {
for (auto const& f : m_vFramesAwaitingWrite) {
if (!f->pMonitor || !f->buffer) {
framesToRemove.push_back(f);
continue;
@@ -428,7 +428,7 @@ void CScreencopyProtocol::onOutputCommit(CMonitor* pMonitor) {
framesToRemove.push_back(f);
}
for (auto& f : framesToRemove) {
for (auto const& f : framesToRemove) {
destroyResource(f.get());
}
}