зеркало из https://github.com/github/ruby.git
process.c: variable as macro argument
* process.c (run_exec_open): use a local variable to get rid of RARRAY_AREF() is evaluated multiple times by RSTRING_PTR(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46439 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
800c7af73c
Коммит
d327c8da66
|
@ -2743,7 +2743,8 @@ run_exec_open(VALUE ary, struct rb_execarg *sargp, char *errmsg, size_t errmsg_b
|
|||
VALUE elt = RARRAY_AREF(ary, i);
|
||||
int fd = FIX2INT(RARRAY_AREF(elt, 0));
|
||||
VALUE param = RARRAY_AREF(elt, 1);
|
||||
char *path = RSTRING_PTR(RARRAY_AREF(param, 0));
|
||||
const VALUE vpath = RARRAY_AREF(param, 0);
|
||||
const char *path = RSTRING_PTR(vpath);
|
||||
int flags = NUM2INT(RARRAY_AREF(param, 1));
|
||||
int perm = NUM2INT(RARRAY_AREF(param, 2));
|
||||
int need_close = 1;
|
||||
|
|
Загрузка…
Ссылка в новой задаче