[svn:parrot] r45233 - trunk/src

chromatic at svn.parrot.org chromatic at svn.parrot.org
Sun Mar 28 09:49:53 UTC 2010


Author: chromatic
Date: Sun Mar 28 09:49:53 2010
New Revision: 45233
URL: https://trac.parrot.org/parrot/changeset/45233

Log:
[src] Removed an unnecessary exists-before-fetch from Parrot_get_HLL_id(); this
speeds up the benchmark of Rakudo startup by 0.573%, which isn't that
impressive, except for the next commit....

Modified:
   trunk/src/hll.c

Modified: trunk/src/hll.c
==============================================================================
--- trunk/src/hll.c	Sun Mar 28 06:38:50 2010	(r45232)
+++ trunk/src/hll.c	Sun Mar 28 09:49:53 2010	(r45233)
@@ -272,15 +272,18 @@
 Parrot_get_HLL_id(PARROT_INTERP, ARGIN_NULLOK(STRING *hll_name))
 {
     ASSERT_ARGS(Parrot_get_HLL_id)
+    PMC *       entry;
     PMC * const hll_info = interp->HLL_info;
-    INTVAL      i;
+    INTVAL      i        = -1;
+
+    if (!hll_name)
+        return i;
 
     START_READ_HLL_INFO(interp, hll_info);
 
-    if (!hll_name || !VTABLE_exists_keyed_str(interp, hll_info, hll_name))
-        i = -1;
-    else {
-        PMC * const entry    = VTABLE_get_pmc_keyed_str(interp, hll_info, hll_name);
+    entry = VTABLE_get_pmc_keyed_str(interp, hll_info, hll_name);
+
+    if (!PMC_IS_NULL(entry)) {
         PMC * const entry_id = VTABLE_get_pmc_keyed_int(interp, entry, e_HLL_id);
         i = VTABLE_get_integer(interp, entry_id);
     }


More information about the parrot-commits mailing list