From 08202d1f0e120bc09431149e3fe2284f992dbb6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=9C=E9=83=A8=E6=98=8C=E5=B9=B3?= Date: Tue, 16 Jun 2020 12:53:24 +0900 Subject: check_exec_redirect: 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. --- process.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'process.c') diff --git a/process.c b/process.c index 054c303679..a0b8467879 100644 --- a/process.c +++ b/process.c @@ -1934,7 +1934,7 @@ check_exec_redirect(VALUE key, VALUE val, struct rb_execarg *eargp) switch (TYPE(val)) { case T_SYMBOL: - if (!(id = rb_check_id(&val))) goto wrong_symbol; + id = rb_check_id(&val); if (id == id_close) { param = Qnil; eargp->fd_close = check_exec_redirect1(eargp->fd_close, key, param); @@ -1952,7 +1952,6 @@ check_exec_redirect(VALUE key, VALUE val, struct rb_execarg *eargp) eargp->fd_dup2 = check_exec_redirect1(eargp->fd_dup2, key, param); } else { - wrong_symbol: rb_raise(rb_eArgError, "wrong exec redirect symbol: %"PRIsVALUE, val); } -- cgit v1.2.3