diff options
-rw-r--r-- | AK/IntrusiveList.h | 6 | ||||
-rw-r--r-- | Kernel/Thread.h | 8 |
2 files changed, 7 insertions, 7 deletions
diff --git a/AK/IntrusiveList.h b/AK/IntrusiveList.h index 59edf40c9d..6382a503b9 100644 --- a/AK/IntrusiveList.h +++ b/AK/IntrusiveList.h @@ -32,7 +32,7 @@ public: Iterator(); Iterator(T* value); - T* operator*() const; + T& operator*() const; T* operator->() const; bool operator==(const Iterator& other) const; bool operator!=(const Iterator& other) const { return !(*this == other); } @@ -78,9 +78,9 @@ inline IntrusiveList<T, member>::Iterator::Iterator(T* value) } template<class T, IntrusiveListNode T::*member> -inline T* IntrusiveList<T, member>::Iterator::operator*() const +inline T& IntrusiveList<T, member>::Iterator::operator*() const { - return m_value; + return *m_value; } template<class T, IntrusiveListNode T::*member> 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; } |