mirror of
https://github.com/hyprwm/Hyprland.git
synced 2025-08-23 16:03:49 -07:00
misc: constify the remaining for loops (#7534)
now we roll loops at blazing constified speed.
This commit is contained in:
@@ -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());
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user