ruby-changes:54267
From: normal <ko1@a...>
Date: Fri, 21 Dec 2018 21:32:54 +0900 (JST)
Subject: [ruby-changes:54267] normal:r66476 (trunk): thread_sync.c (rb_mutex_abandon_keeping_mutexes): remove unnecessary check
normal 2018-12-21 21:32:48 +0900 (Fri, 21 Dec 2018) New Revision: 66476 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=66476 Log: thread_sync.c (rb_mutex_abandon_keeping_mutexes): remove unnecessary check rb_mutex_abandon_all functions fine when passed a NULL value, so let the compiler deal with the complexity of the branch instead of the person reading the code. Modified files: trunk/thread_sync.c Index: thread_sync.c =================================================================== --- thread_sync.c (revision 66475) +++ thread_sync.c (revision 66476) @@ -407,9 +407,7 @@ rb_mutex_unlock(VALUE self) https://github.com/ruby/ruby/blob/trunk/thread_sync.c#L407 static void rb_mutex_abandon_keeping_mutexes(rb_thread_t *th) { - if (th->keeping_mutexes) { - rb_mutex_abandon_all(th->keeping_mutexes); - } + rb_mutex_abandon_all(th->keeping_mutexes); th->keeping_mutexes = NULL; } -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/