[svn:parrot] r39218 - trunk/src/pmc

Infinoid at svn.parrot.org Infinoid at svn.parrot.org
Thu May 28 13:37:56 UTC 2009


Author: Infinoid
Date: Thu May 28 13:37:55 2009
New Revision: 39218
URL: https://trac.parrot.org/parrot/changeset/39218

Log:
[core] Revert r38000.  See TT #713.

Modified:
   trunk/src/pmc/integer.pmc

Modified: trunk/src/pmc/integer.pmc
==============================================================================
--- trunk/src/pmc/integer.pmc	Thu May 28 13:11:33 2009	(r39217)
+++ trunk/src/pmc/integer.pmc	Thu May 28 13:37:55 2009	(r39218)
@@ -425,32 +425,26 @@
 
 */
 
-    VTABLE void i_add(PMC *value) {
-        const INTVAL type = value->vtable->base_type;
+    MULTI void i_add(Integer value) {
+        STATICSELF.i_add_int(VTABLE_get_integer(INTERP, value));
+    }
 
-        switch (type) {
-            case enum_class_Integer:
-                STATICSELF.i_add_int(VTABLE_get_integer(INTERP, value));
-                break;
 
-            case enum_class_Complex:
-                pmc_reuse(INTERP, SELF, enum_class_Complex, 0);
-                VTABLE_set_number_native(INTERP, SELF,
-                        SELF.get_integer() + VTABLE_get_number(INTERP, value));
-                break;
+    MULTI void i_add(Complex value) {
+        const INTVAL a = SELF.get_integer();
 
-            default:
-                VTABLE_set_number_native(INTERP, SELF,
-                        SELF.get_integer() + VTABLE_get_number(INTERP, value));
-                break;
-        }
+        pmc_reuse(INTERP, SELF, enum_class_Complex, 0);
+        VTABLE_set_number_native(INTERP, SELF,
+                SELF.get_integer() + VTABLE_get_number(INTERP, value));
     }
 
+
     MULTI void i_add(DEFAULT value) {
         VTABLE_set_number_native(INTERP, SELF,
                 SELF.get_integer() + VTABLE_get_number(INTERP, value));
     }
 
+
     VTABLE void i_add_int(INTVAL b) {
         const INTVAL a = SELF.get_integer();
         const INTVAL c = a + b;


More information about the parrot-commits mailing list