projects
/
platform
/
upstream
/
glib.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2bfcffd
)
g_str_hash: clean up code
author
Ryan Lortie
<desrt@desrt.ca>
Wed, 17 Nov 2010 16:57:48 +0000
(11:57 -0500)
committer
Ryan Lortie
<desrt@desrt.ca>
Wed, 17 Nov 2010 17:24:53 +0000
(12:24 -0500)
Un-unroll the first iteration.
No functional changes here.
glib/gstring.c
patch
|
blob
|
history
diff --git
a/glib/gstring.c
b/glib/gstring.c
index
9b25fb6
..
946206f
100644
(file)
--- a/
glib/gstring.c
+++ b/
glib/gstring.c
@@
-130,12
+130,11
@@
guint
g_str_hash (gconstpointer v)
{
/* 31 bit hash function */
- const signed char *p
= v
;
- guint32 h =
*p
;
+ const signed char *p;
+ guint32 h =
0
;
- if (h)
- for (p += 1; *p != '\0'; p++)
- h = (h << 5) - h + *p;
+ for (p = v; *p != '\0'; p++)
+ h = (h << 5) - h + *p;
return h;
}