summaryrefslogtreecommitdiff
path: root/src/managers/eventLoop/EventLoopManager.cpp
diff options
context:
space:
mode:
authorTom Englund <tomenglund26@gmail.com>2024-08-26 20:24:30 +0200
committerGitHub <noreply@github.com>2024-08-26 20:24:30 +0200
commit72c7818ae66a18d126e2b4245d649fe3a93d3b8e (patch)
tree194361ee0d4f92eea809b7904d39f02793c55e13 /src/managers/eventLoop/EventLoopManager.cpp
parent1ea47950f4262ec1215087948c7275f8e0115af2 (diff)
misc: constify the remaining for loops (#7534)
now we roll loops at blazing constified speed.
Diffstat (limited to 'src/managers/eventLoop/EventLoopManager.cpp')
-rw-r--r--src/managers/eventLoop/EventLoopManager.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/managers/eventLoop/EventLoopManager.cpp b/src/managers/eventLoop/EventLoopManager.cpp
index d1b85cf2..e9b0fa3e 100644
--- a/src/managers/eventLoop/EventLoopManager.cpp
+++ b/src/managers/eventLoop/EventLoopManager.cpp
@@ -19,7 +19,7 @@ CEventLoopManager::CEventLoopManager(wl_display* display, wl_event_loop* wlEvent
}
CEventLoopManager::~CEventLoopManager() {
- for (auto& eventSource : m_sWayland.aqEventSources) {
+ for (auto const& eventSource : m_sWayland.aqEventSources) {
wl_event_source_remove(eventSource);
}
@@ -46,7 +46,7 @@ void CEventLoopManager::enterLoop() {
m_sWayland.eventSource = wl_event_loop_add_fd(m_sWayland.loop, m_sTimers.timerfd, WL_EVENT_READABLE, timerWrite, nullptr);
aqPollFDs = g_pCompositor->m_pAqBackend->getPollFDs();
- for (auto& fd : aqPollFDs) {
+ for (auto const& fd : aqPollFDs) {
m_sWayland.aqEventSources.emplace_back(wl_event_loop_add_fd(m_sWayland.loop, fd->fd, WL_EVENT_READABLE, aquamarineFDWrite, fd.get()));
}
@@ -56,7 +56,7 @@ void CEventLoopManager::enterLoop() {
}
void CEventLoopManager::onTimerFire() {
- for (auto& t : m_sTimers.timers) {
+ for (auto const& t : m_sTimers.timers) {
if (t.strongRef() > 1 /* if it's 1, it was lost. Don't call it. */ && t->passed() && !t->cancelled())
t->call(t);
}
@@ -93,7 +93,7 @@ void CEventLoopManager::nudgeTimers() {
long nextTimerUs = 10 * 1000 * 1000; // 10s
- for (auto& t : m_sTimers.timers) {
+ for (auto const& t : m_sTimers.timers) {
if (const auto µs = t->leftUs(); µs < nextTimerUs)
nextTimerUs = µs;
}
@@ -122,7 +122,7 @@ void CEventLoopManager::doLater(const std::function<void()>& fn) {
auto cpy = IDLE->fns;
IDLE->fns.clear();
IDLE->eventSource = nullptr;
- for (auto& c : cpy) {
+ for (auto const& c : cpy) {
if (c)
c();
}