diff options
author | 卜部昌平 <[email protected]> | 2020-06-19 10:56:25 +0900 |
---|---|---|
committer | 卜部昌平 <[email protected]> | 2020-06-29 11:05:41 +0900 |
commit | f402dc35572ae6167737e82585f92d3cc861d1da (patch) | |
tree | 5a76fca327fc7b79fb0231ceb59273cb1e897a9f /thread_sync.c | |
parent | 8fc8912109cf7426afe6334850204744988c7a3d (diff) |
rb_szqueue_push: do not goto into a branch
I'm not necessarily against every goto in general, but jumping into a
branch is definitely a bad idea. Better refactor.
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/3247
Diffstat (limited to 'thread_sync.c')
-rw-r--r-- | thread_sync.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/thread_sync.c b/thread_sync.c index 3689dee789..3b8c5364a9 100644 --- a/thread_sync.c +++ b/thread_sync.c @@ -1156,7 +1156,7 @@ rb_szqueue_push(int argc, VALUE *argv, VALUE self) rb_raise(rb_eThreadError, "queue full"); } else if (queue_closed_p(self)) { - goto closed; + break; } else { struct queue_waiter qw; @@ -1172,7 +1172,6 @@ rb_szqueue_push(int argc, VALUE *argv, VALUE self) } if (queue_closed_p(self)) { - closed: raise_closed_queue_error(self); } |