mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
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.
This commit is contained in:
parent
8fc8912109
commit
f402dc3557
Notes:
git
2020-06-29 11:06:42 +09:00
1 changed files with 1 additions and 2 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue