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

chromatic at svn.parrot.org chromatic at svn.parrot.org
Tue Aug 10 22:49:38 UTC 2010


Author: chromatic
Date: Tue Aug 10 22:49:37 2010
New Revision: 48391
URL: https://trac.parrot.org/parrot/changeset/48391

Log:
[PMC] Reordered some Hash code for clarity.

Modified:
   trunk/src/pmc/hash.pmc

Modified: trunk/src/pmc/hash.pmc
==============================================================================
--- trunk/src/pmc/hash.pmc	Tue Aug 10 22:49:34 2010	(r48390)
+++ trunk/src/pmc/hash.pmc	Tue Aug 10 22:49:37 2010	(r48391)
@@ -697,12 +697,12 @@
 
         GET_ATTR_hash(INTERP, SELF, hash);
 
-        /* special case the most key type, for speed */
-        if (hash->key_type == Hash_key_type_STRING)
-            b = parrot_hash_get_bucket(INTERP, hash, key);
-        else
-            b = parrot_hash_get_bucket(INTERP, hash,
-                hash_key_from_string(INTERP, hash, key));
+        /* special case the most likely key type, for speed */
+        key = hash->key_type == Hash_key_type_STRING
+            ? key
+            : hash_key_from_string(INTERP, hash, key);
+
+        b = parrot_hash_get_bucket(INTERP, hash, key);
 
         if (!b)
             return PMCNULL;


More information about the parrot-commits mailing list