diff options
author | Andreas Kling <awesomekling@gmail.com> | 2019-08-17 11:25:32 +0200 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2019-08-17 11:25:32 +0200 |
commit | e3f3c980bfcc4519610cfd806b63512b90242a7e (patch) | |
tree | 1d1b5806a05c450a9cb13f02c02b0f081fcd11d0 /Kernel/Thread.h | |
parent | 6b81d8de700f456c8a8cfed9412f35020b2ac4e6 (diff) | |
download | serenity-e3f3c980bfcc4519610cfd806b63512b90242a7e.zip |
IntrusiveList: Make Iterator::operator* return a T&
This makes iteration a little more pleasant :^)
Diffstat (limited to 'Kernel/Thread.h')
-rw-r--r-- | Kernel/Thread.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Kernel/Thread.h b/Kernel/Thread.h index 18bfbb7bf6..b52a3250fe 100644 --- a/Kernel/Thread.h +++ b/Kernel/Thread.h @@ -405,9 +405,9 @@ inline IterationDecision Scheduler::for_each_runnable(Callback callback) ASSERT_INTERRUPTS_DISABLED(); auto& tl = g_scheduler_data->m_runnable_threads; for (auto it = tl.begin(); it != tl.end();) { - auto thread = *it; + auto& thread = *it; it = ++it; - if (callback(*thread) == IterationDecision::Break) + if (callback(thread) == IterationDecision::Break) return IterationDecision::Break; } @@ -420,9 +420,9 @@ inline IterationDecision Scheduler::for_each_nonrunnable(Callback callback) ASSERT_INTERRUPTS_DISABLED(); auto& tl = g_scheduler_data->m_nonrunnable_threads; for (auto it = tl.begin(); it != tl.end();) { - auto thread = *it; + auto& thread = *it; it = ++it; - if (callback(*thread) == IterationDecision::Break) + if (callback(thread) == IterationDecision::Break) return IterationDecision::Break; } |