mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Remove unnecessary branch in UnboundMethod#bind
Co-authored-by: Michael Herold <michael.herold@shopify.com>
This commit is contained in:
parent
b83074dac7
commit
76a6c5d6d1
Notes:
git
2022-11-04 12:57:28 +00:00
1 changed files with 1 additions and 2 deletions
3
proc.c
3
proc.c
|
@ -2571,8 +2571,7 @@ convert_umethod_to_method_components(const struct METHOD *data, VALUE recv, VALU
|
||||||
VALUE refined_class = rb_refinement_module_get_refined_class(methclass);
|
VALUE refined_class = rb_refinement_module_get_refined_class(methclass);
|
||||||
if (!NIL_P(refined_class)) methclass = refined_class;
|
if (!NIL_P(refined_class)) methclass = refined_class;
|
||||||
}
|
}
|
||||||
if (!RB_TYPE_P(methclass, T_MODULE) &&
|
if (!RB_TYPE_P(methclass, T_MODULE) && !rb_obj_is_kind_of(recv, methclass)) {
|
||||||
methclass != CLASS_OF(recv) && !rb_obj_is_kind_of(recv, methclass)) {
|
|
||||||
if (FL_TEST(methclass, FL_SINGLETON)) {
|
if (FL_TEST(methclass, FL_SINGLETON)) {
|
||||||
rb_raise(rb_eTypeError,
|
rb_raise(rb_eTypeError,
|
||||||
"singleton method called for a different object");
|
"singleton method called for a different object");
|
||||||
|
|
Loading…
Reference in a new issue