Ticket #1144: tt1144.patch
File tt1144.patch, 1.4 KB (added by whiteknight, 12 years ago) |
---|
-
src/multidispatch.c
633 633 continue; 634 634 635 635 /* promote primitives to their PMC equivalents, as PCC will autobox 636 * the distance penalty makes primitive variants look cheaper */ 636 * them. If it's a direct autobox, int->Integer, str->String, or 637 * num->Num, the distance is 1 and we move to the next arg. If it's 638 * autoboxing to "any" PMC type, we increment the distance and continue 639 * weighing other things. A direct autobox should be cheaper than an 640 * autobox plus type conversion or implicit type acceptance. */ 637 641 switch (type_call) { 638 642 case enum_type_INTVAL: 639 643 if (type_sig == enum_class_Integer) { dist++; continue; } 644 if (type_sig == enum_type_PMC) dist++; 640 645 break; 641 646 case enum_type_FLOATVAL: 642 647 if (type_sig == enum_class_Float) { dist++; continue; } 648 if (type_sig == enum_type_PMC) dist++; 643 649 break; 644 650 case enum_type_STRING: 645 651 if (type_sig == enum_class_String) { dist++; continue; } 652 if (type_sig == enum_type_PMC) dist++; 646 653 break; 647 654 default: 648 655 break;