From 4255f25647dee3ae6098d14adbb3db0749935120 Mon Sep 17 00:00:00 2001 From: bunnei Date: Tue, 20 Jan 2015 18:40:01 -0500 Subject: Thread: Use std::find in CheckWait_WaitObject. --- src/core/hle/kernel/thread.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/core/hle/kernel/thread.cpp b/src/core/hle/kernel/thread.cpp index 3ca9603c2..58523e145 100644 --- a/src/core/hle/kernel/thread.cpp +++ b/src/core/hle/kernel/thread.cpp @@ -85,10 +85,11 @@ static void ChangeReadyState(Thread* t, bool ready) { /// Check if a thread is waiting on a the specified wait object static bool CheckWait_WaitObject(const Thread* thread, WaitObject* wait_object) { - for (auto itr = thread->wait_objects.begin(); itr != thread->wait_objects.end(); ++itr) { - if (*itr == wait_object) - return (thread->IsWaiting()); - } + auto itr = std::find(thread->wait_objects.begin(), thread->wait_objects.end(), wait_object); + + if (itr != thread->wait_objects.end()) + return thread->IsWaiting(); + return false; } -- cgit v1.2.3