mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
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
This commit is contained in:
parent
fae144419c
commit
a2fcdb4fbe
1 changed files with 4 additions and 5 deletions
7
iseq.c
7
iseq.c
|
@ -479,12 +479,11 @@ rb_iseq_new_with_opt(NODE *node, VALUE name, VALUE path, VALUE absolute_path,
|
||||||
const rb_iseq_t *
|
const rb_iseq_t *
|
||||||
rb_iseq_load_iseq(VALUE fname)
|
rb_iseq_load_iseq(VALUE fname)
|
||||||
{
|
{
|
||||||
if (rb_respond_to(rb_cISeq, rb_intern("load_iseq"))) {
|
VALUE iseqv = rb_check_funcall(rb_cISeq, rb_intern("load_iseq"), 1, &fname);
|
||||||
VALUE iseqv = rb_funcall(rb_cISeq, rb_intern("load_iseq"), 1, fname);
|
|
||||||
if (CLASS_OF(iseqv) == rb_cISeq) {
|
if (!SPECIAL_CONST_P(iseqv) && RBASIC_CLASS(iseqv) == rb_cISeq) {
|
||||||
return iseqw_check(iseqv);
|
return iseqw_check(iseqv);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue