From be6b462489e42b6a8ee60ba96fc18fcc9794f819 Mon Sep 17 00:00:00 2001 From: Kazuki Tsujimoto Date: Tue, 11 Jun 2019 00:20:10 +0900 Subject: Use checktype for performance --- compile.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'compile.c') diff --git a/compile.c b/compile.c index 202157131f..80dc5e729a 100644 --- a/compile.c +++ b/compile.c @@ -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); @@ -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) { -- cgit v1.2.3