summaryrefslogtreecommitdiff
path: root/thread_sync.c
diff options
context:
space:
mode:
authornormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-12-21 12:32:48 +0000
committernormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-12-21 12:32:48 +0000
commit2a742d5f9b6b61f078fb9d73d7025c227b53f52b (patch)
treea1ecf8bf96c39e77fbbc5c0a9573433cb634eec5 /thread_sync.c
parent010a742cb6772d4a27d5fee3606ac9385ca246e0 (diff)
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. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66476 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'thread_sync.c')
-rw-r--r--thread_sync.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/thread_sync.c b/thread_sync.c
index 36ed71bf88..61e952be41 100644
--- a/thread_sync.c
+++ b/thread_sync.c
@@ -407,9 +407,7 @@ rb_mutex_unlock(VALUE self)
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;
}