Use bit manipulation instead of memory access, improve eet speed with big edje file.

SVN revision: 35946
This commit is contained in:
Cedric BAIL 2008-09-11 11:24:13 +00:00
parent 5811041053
commit 4762661711
1 changed files with 3 additions and 14 deletions

View File

@ -13,21 +13,9 @@ _eet_hash_gen(const char *key, int hash_size)
{
int hash_num = 0;
int value, i;
int mask;
unsigned char *ptr;
const int masks[9] =
{
0x00,
0x01,
0x03,
0x07,
0x0f,
0x1f,
0x3f,
0x7f,
0xff
};
/* no string - index 0 */
if (!key) return 0;
@ -38,7 +26,8 @@ _eet_hash_gen(const char *key, int hash_size)
hash_num ^= (value | (value << 8)) >> (i & 0x7);
/* mask it */
hash_num &= masks[hash_size];
mask = (1 << hash_size) - 1;
hash_num &= mask;
/* return it */
return hash_num;
}