From f402dc35572ae6167737e82585f92d3cc861d1da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=9C=E9=83=A8=E6=98=8C=E5=B9=B3?= Date: Fri, 19 Jun 2020 10:56:25 +0900 Subject: [PATCH] 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. --- thread_sync.c | 3 +-- 1 file changed, 1 insertion(+), 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); }