From 2b52c0c231c5b9abc9cb4e9b52bb3c4de2fd7f79 Mon Sep 17 00:00:00 2001 From: Ivan Maidanski Date: Thu, 6 Apr 2023 09:19:10 +0300 Subject: Use EXPECT() in GC_lookup_thread and GC_lookup_by_pthread (refactoring) * pthread_support.c (GC_lookup_thread): Expect break on the first iteration of the loop. * win32_threads.c [GC_PTHREADS] (GC_lookup_by_pthread): Expect return on the first iteration of the first loop. --- pthread_support.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'pthread_support.c') diff --git a/pthread_support.c b/pthread_support.c index 1753fa89..6430f60b 100644 --- a/pthread_support.c +++ b/pthread_support.c @@ -832,7 +832,7 @@ GC_INNER GC_thread GC_lookup_thread(thread_id_t id) # endif for (p = GC_threads[THREAD_TABLE_INDEX(id)]; p != NULL; p = p -> tm.next) { - if (THREAD_ID_EQUAL(p -> id, id)) break; + if (EXPECT(THREAD_ID_EQUAL(p -> id, id), TRUE)) break; } return p; } -- cgit v1.2.1