mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-02-03 17:56:17 +01:00
g_str_hash: clean up code
Un-unroll the first iteration. No functional changes here.
This commit is contained in:
parent
2bfcffde9a
commit
f50a99e782
@ -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;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user