diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-12-12 07:07:42 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-12-12 07:07:42 +0000 |
commit | b691dfe19942aacf9ebbfb1af91cc4c6cabf91eb (patch) | |
tree | 3827ab0d44d3f7f9f102bb6f2d79c5fa80a5dbd3 /iseq.c | |
parent | 9ff3d9dec9c1bb1783591de212c9deb5d542f98f (diff) | |
download | ruby-b691dfe19942aacf9ebbfb1af91cc4c6cabf91eb.tar.gz |
iseq.c: use rb_check_funcall
* iseq.c (rb_iseq_load_iseq): use rb_check_funcall instead of
repeating method search.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53048 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'iseq.c')
-rw-r--r-- | iseq.c | 9 |
1 files changed, 4 insertions, 5 deletions
@@ -479,11 +479,10 @@ rb_iseq_new_with_opt(NODE *node, VALUE name, VALUE path, VALUE absolute_path, const rb_iseq_t * rb_iseq_load_iseq(VALUE fname) { - if (rb_respond_to(rb_cISeq, rb_intern("load_iseq"))) { - VALUE iseqv = rb_funcall(rb_cISeq, rb_intern("load_iseq"), 1, fname); - if (CLASS_OF(iseqv) == rb_cISeq) { - return iseqw_check(iseqv); - } + VALUE iseqv = rb_check_funcall(rb_cISeq, rb_intern("load_iseq"), 1, &fname); + + if (!SPECIAL_CONST_P(iseqv) && RBASIC_CLASS(iseqv) == rb_cISeq) { + return iseqw_check(iseqv); } return NULL; |