g_str_hash: clean up code

Un-unroll the first iteration.

No functional changes here.
This commit is contained in:
Ryan Lortie 2010-11-17 11:57:48 -05:00
parent 2bfcffde9a
commit f50a99e782

View File

@ -130,12 +130,11 @@ guint
g_str_hash (gconstpointer v) g_str_hash (gconstpointer v)
{ {
/* 31 bit hash function */ /* 31 bit hash function */
const signed char *p = v; const signed char *p;
guint32 h = *p; guint32 h = 0;
if (h) for (p = v; *p != '\0'; p++)
for (p += 1; *p != '\0'; p++) h = (h << 5) - h + *p;
h = (h << 5) - h + *p;
return h; return h;
} }