Skip to content

Commit

Permalink
Use checktype for performance
Browse files Browse the repository at this point in the history
  • Loading branch information
k-tsj committed Jun 10, 2019
1 parent f0bfa71 commit be6b462
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions compile.c
Expand Up @@ -5332,8 +5332,7 @@ iseq_compile_pattern_each(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *c
ADD_SEND(ret, line, rb_intern("deconstruct"), INT2FIX(0));

ADD_INSN(ret, line, dup);
ADD_INSN1(ret, line, putobject, rb_cArray);
ADD_INSN1(ret, line, checkmatch, INT2FIX(VM_CHECKMATCH_TYPE_CASE));
ADD_INSN1(ret, line, checktype, INT2FIX(T_ARRAY));
ADD_INSNL(ret, line, branchunless, type_error);

ADD_INSN(ret, line, dup);
Expand Down Expand Up @@ -5506,8 +5505,7 @@ iseq_compile_pattern_each(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *c
ADD_SEND(ret, line, rb_intern("deconstruct_keys"), INT2FIX(1));

ADD_INSN(ret, line, dup);
ADD_INSN1(ret, line, putobject, rb_cHash);
ADD_INSN1(ret, line, checkmatch, INT2FIX(VM_CHECKMATCH_TYPE_CASE));
ADD_INSN1(ret, line, checktype, INT2FIX(T_HASH));
ADD_INSNL(ret, line, branchunless, type_error);

if (node->nd_pkwrestarg) {
Expand Down

0 comments on commit be6b462

Please sign in to comment.