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

chromatic at svn.parrot.org chromatic at svn.parrot.org
Sat Sep 18 03:22:52 UTC 2010


Author: chromatic
Date: Sat Sep 18 03:22:52 2010
New Revision: 49128
URL: https://trac.parrot.org/parrot/changeset/49128

Log:
[PMC] Optimized Hash's in get_pmc_keyed_str().

Don't fetch buckets from an empty hash.

Modified:
   trunk/src/pmc/hash.pmc

Modified: trunk/src/pmc/hash.pmc
==============================================================================
--- trunk/src/pmc/hash.pmc	Sat Sep 18 03:22:48 2010	(r49127)
+++ trunk/src/pmc/hash.pmc	Sat Sep 18 03:22:52 2010	(r49128)
@@ -763,6 +763,9 @@
 
         GET_ATTR_hash(INTERP, SELF, hash);
 
+        if (!hash->entries)
+            return PMCNULL;
+
         /* special case the most likely key type, for speed */
         if (hash->key_type != Hash_key_type_STRING)
             key = (STRING *)hash_key_from_string(INTERP, hash, key);


More information about the parrot-commits mailing list