зеркало из https://github.com/github/ruby.git
check_exec_redirect_fd: 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:
Родитель
2bfac015d3
Коммит
9298631316
|
@ -1886,8 +1886,7 @@ check_exec_redirect_fd(VALUE v, int iskey)
|
|||
fd = fptr->fd;
|
||||
}
|
||||
else {
|
||||
wrong:
|
||||
rb_raise(rb_eArgError, "wrong exec redirect");
|
||||
goto wrong;
|
||||
}
|
||||
if (fd < 0) {
|
||||
rb_raise(rb_eArgError, "negative file descriptor");
|
||||
|
@ -1898,6 +1897,9 @@ check_exec_redirect_fd(VALUE v, int iskey)
|
|||
}
|
||||
#endif
|
||||
return INT2FIX(fd);
|
||||
|
||||
wrong:
|
||||
rb_raise(rb_eArgError, "wrong exec redirect");
|
||||
}
|
||||
|
||||
static VALUE
|
||||
|
|
Загрузка…
Ссылка в новой задаче