mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Split the optimizable range item conditions
This commit is contained in:
parent
07179c5c0f
commit
0bfa479c52
1 changed files with 9 additions and 1 deletions
10
compile.c
10
compile.c
|
@ -5180,7 +5180,15 @@ compile_named_capture_assign(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE
|
|||
static int
|
||||
optimizable_range_item_p(const NODE *n)
|
||||
{
|
||||
return (n && nd_type(n) == NODE_LIT && RB_INTEGER_TYPE_P(n->nd_lit)) || (n && nd_type(n) == NODE_NIL);
|
||||
if (!n) return FALSE;
|
||||
switch (nd_type(n)) {
|
||||
case NODE_LIT:
|
||||
return RB_INTEGER_TYPE_P(n->nd_lit);
|
||||
case NODE_NIL:
|
||||
return TRUE;
|
||||
default:
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
static int
|
||||
|
|
Loading…
Reference in a new issue