[svn:parrot] r39364 - branches/pmc_i_ops/src/pmc

bacek at svn.parrot.org bacek at svn.parrot.org
Wed Jun 3 13:35:16 UTC 2009


Author: bacek
Date: Wed Jun  3 13:35:16 2009
New Revision: 39364
URL: https://trac.parrot.org/parrot/changeset/39364

Log:
[pmc] Use MULTI instead of handcrafted switch for is_equal

Modified:
   branches/pmc_i_ops/src/pmc/integer.pmc

Modified: branches/pmc_i_ops/src/pmc/integer.pmc
==============================================================================
--- branches/pmc_i_ops/src/pmc/integer.pmc	Wed Jun  3 13:34:54 2009	(r39363)
+++ branches/pmc_i_ops/src/pmc/integer.pmc	Wed Jun  3 13:35:16 2009	(r39364)
@@ -904,23 +904,13 @@
 
 */
 
-    VTABLE INTVAL is_equal(PMC *value) {
-        INTVAL retval;
-        PMC *temp;
-
-        switch (value->vtable->base_type) {
-            case enum_class_BigInt:
-                temp = pmc_new(INTERP, enum_class_BigInt);
-                VTABLE_set_integer_native(INTERP, temp, SELF.get_integer());
-                Parrot_mmd_multi_dispatch_from_c_args(interp,
-                    "is_equal", "PP->I", temp, value, &retval);
-                return retval;
-                break;
-            default:
-                return (VTABLE_get_integer(INTERP, SELF)
-                    ==  VTABLE_get_integer(INTERP, value));
-                break;
-        }
+    MULTI INTVAL is_equal(BigInt value) {
+        return VTABLE_is_equal(INTERP, value, SELF);
+    }
+
+    MULTI INTVAL is_equal(DEFAULT *value) {
+        return (VTABLE_get_integer(INTERP, SELF)
+            ==  VTABLE_get_integer(INTERP, value));
     }
 
 


More information about the parrot-commits mailing list