diff options
author | 卜部昌平 <[email protected]> | 2020-06-16 12:53:24 +0900 |
---|---|---|
committer | 卜部昌平 <[email protected]> | 2020-06-29 11:05:41 +0900 |
commit | 08202d1f0e120bc09431149e3fe2284f992dbb6d (patch) | |
tree | 6518e1c6b1af4f9024c31ad680c9fb31802ed8d1 /process.c | |
parent | 92986313161c36157187ed7078fc4909bbf9bc04 (diff) |
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.
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/3247
Diffstat (limited to 'process.c')
-rw-r--r-- | process.c | 3 |
1 files changed, 1 insertions, 2 deletions
@@ -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); } |