[svn:parrot] r47815 - trunk/src
chromatic at svn.parrot.org
chromatic at svn.parrot.org
Fri Jun 25 03:13:25 UTC 2010
Author: chromatic
Date: Fri Jun 25 03:13:25 2010
New Revision: 47815
URL: https://trac.parrot.org/parrot/changeset/47815
Log:
[hash] Reduced hash thawing costs.
Avoided double calls to parrot_hash_put() in hash_thaw(). This is a minor
optimization.
Modified:
trunk/src/hash.c
Modified: trunk/src/hash.c
==============================================================================
--- trunk/src/hash.c Fri Jun 25 03:12:52 2010 (r47814)
+++ trunk/src/hash.c Fri Jun 25 03:13:25 2010 (r47815)
@@ -601,24 +601,25 @@
for (entry_index = 0; entry_index < num_entries; ++entry_index) {
HashBucket *b;
+ void *key;
switch (key_type) {
case Hash_key_type_int:
{
const INTVAL i_key = VTABLE_shift_integer(interp, info);
- b = parrot_hash_put(interp, hash, (void*)i_key, NULL);
+ key = (void *)i_key;
}
break;
case Hash_key_type_STRING:
{
STRING * const s_key = VTABLE_shift_string(interp, info);
- b = parrot_hash_put(interp, hash, s_key, NULL);
+ key = (void *)s_key;
}
break;
case Hash_key_type_PMC:
{
PMC * const p_key = VTABLE_shift_pmc(interp, info);
- b = parrot_hash_put(interp, hash, p_key, NULL);
+ key = (void *)p_key;
break;
}
default:
@@ -631,19 +632,19 @@
case enum_hash_int:
{
const INTVAL i = VTABLE_shift_integer(interp, info);
- b->value = (void *)i;
+ parrot_hash_put(interp, hash, key, (void *)i);
break;
}
case enum_hash_string:
{
STRING * const s = VTABLE_shift_string(interp, info);
- b->value = (void *)s;
+ parrot_hash_put(interp, hash, key, (void *)s);
break;
}
case enum_hash_pmc:
{
PMC * const p = VTABLE_shift_pmc(interp, info);
- b->value = (void *)p;
+ parrot_hash_put(interp, hash, key, (void *)p);
break;
}
default:
More information about the parrot-commits
mailing list