[svn:parrot] r38565 - trunk/src

chromatic at svn.parrot.org chromatic at svn.parrot.org
Fri May 8 00:53:47 UTC 2009


Author: chromatic
Date: Fri May  8 00:53:46 2009
New Revision: 38565
URL: https://trac.parrot.org/parrot/changeset/38565

Log:
[oo] Avoided a dual-lookup for vtable overrides in class cache.

Modified:
   trunk/src/oo.c

Modified: trunk/src/oo.c
==============================================================================
--- trunk/src/oo.c	Fri May  8 00:53:06 2009	(r38564)
+++ trunk/src/oo.c	Fri May  8 00:53:46 2009	(r38565)
@@ -366,13 +366,14 @@
 {
     ASSERT_ARGS(Parrot_oo_find_vtable_override)
     Parrot_Class_attributes * const _class = PARROT_CLASS(classobj);
+    PMC                            *result =
+        VTABLE_get_pmc_keyed_str(interp, _class->parent_overrides, name);
 
-    if (VTABLE_exists_keyed_str(interp, _class->parent_overrides, name))
-        return VTABLE_get_pmc_keyed_str(interp, _class->parent_overrides, name);
+    if (!PMC_IS_NULL(result))
+        return result;
     else {
         /* Walk and search for the vtable method. */
         const INTVAL num_classes = VTABLE_elements(interp, _class->all_parents);
-        PMC         *result      = PMCNULL;
         INTVAL       i;
 
         for (i = 0; i < num_classes; i++) {


More information about the parrot-commits mailing list