зеркало из https://github.com/github/ruby.git
compile.c: omit newhash
* compile.c (iseq_compile_each): omit creating literal-only hash to be popped immediately. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57892 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
ae46708c10
Коммит
c0764a3cd8
|
@ -5521,11 +5521,12 @@ iseq_compile_each0(rb_iseq_t *iseq, LINK_ANCHOR *const ret, NODE *node, int popp
|
||||||
INIT_ANCHOR(list);
|
INIT_ANCHOR(list);
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case NODE_ARRAY:
|
case NODE_ARRAY:
|
||||||
compile_array(iseq, list, node->nd_head, COMPILE_ARRAY_TYPE_HASH);
|
compile_array_(iseq, list, node->nd_head, COMPILE_ARRAY_TYPE_HASH, NULL, popped);
|
||||||
ADD_SEQ(ret, list);
|
ADD_SEQ(ret, list);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case NODE_ZARRAY:
|
case NODE_ZARRAY:
|
||||||
|
if (popped) break;
|
||||||
ADD_INSN1(ret, line, newhash, INT2FIX(0));
|
ADD_INSN1(ret, line, newhash, INT2FIX(0));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -5533,10 +5534,6 @@ iseq_compile_each0(rb_iseq_t *iseq, LINK_ANCHOR *const ret, NODE *node, int popp
|
||||||
compile_bug(ERROR_ARGS_AT(node->nd_head) "can't make hash with this node: %s",
|
compile_bug(ERROR_ARGS_AT(node->nd_head) "can't make hash with this node: %s",
|
||||||
ruby_node_name(type));
|
ruby_node_name(type));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (popped) {
|
|
||||||
ADD_INSN(ret, line, pop);
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case NODE_RETURN:{
|
case NODE_RETURN:{
|
||||||
|
|
Загрузка…
Ссылка в новой задаче