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
@ -1156,7 +1156,7 @@ rb_szqueue_push(int argc, VALUE *argv, VALUE self)
|
|||||||
rb_raise(rb_eThreadError, "queue full");
|
rb_raise(rb_eThreadError, "queue full");
|
||||||
}
|
}
|
||||||
else if (queue_closed_p(self)) {
|
else if (queue_closed_p(self)) {
|
||||||
goto closed;
|
break;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
struct queue_waiter qw;
|
struct queue_waiter qw;
|
||||||
@ -1172,7 +1172,6 @@ rb_szqueue_push(int argc, VALUE *argv, VALUE self)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (queue_closed_p(self)) {
|
if (queue_closed_p(self)) {
|
||||||
closed:
|
|
||||||
raise_closed_queue_error(self);
|
raise_closed_queue_error(self);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user