浏览代码

Thread: Updated VerifyWait to be more readable (but functionally the same).

bunnei 12 年之前
父节点
当前提交
12e2a59565
共有 1 个文件被更改,包括 3 次插入4 次删除
  1. 3 4
      src/core/hle/kernel/thread.cpp

+ 3 - 4
src/core/hle/kernel/thread.cpp

@@ -146,12 +146,11 @@ void ChangeReadyState(Thread* t, bool ready) {
 inline bool VerifyWait(const Handle& thread, WaitType type, Handle handle) {
 inline bool VerifyWait(const Handle& thread, WaitType type, Handle handle) {
     Handle wait_id = 0;
     Handle wait_id = 0;
     Thread *t = g_object_pool.GetFast<Thread>(thread);
     Thread *t = g_object_pool.GetFast<Thread>(thread);
-    if (t) {
-        if (type == t->wait_type && handle == t->wait_handle) {
-            return true;
-        }
+    if (t != nullptr && type == t->wait_type && handle == t->wait_handle) {
+        return true;
     } else {
     } else {
         ERROR_LOG(KERNEL, "thread 0x%08X does not exist", thread);
         ERROR_LOG(KERNEL, "thread 0x%08X does not exist", thread);
+        return false;
     }
     }
     return false;
     return false;
 }
 }