projects
/
oweals
/
musl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6ba5517
)
dynlink.c: use a faster expression in gnu_hash
author
Alexander Monakov
<amonakov@ispras.ru>
Sat, 27 Jun 2015 23:48:30 +0000
(
02:48
+0300)
committer
Rich Felker
<dalias@aerifal.cx>
Sun, 28 Jun 2015 01:48:19 +0000
(21:48 -0400)
With -Os, GCC uses a multiply rather than a shift and addition for 'h*33'.
Use a more efficient expression explicitely.
src/ldso/dynlink.c
patch
|
blob
|
history
diff --git
a/src/ldso/dynlink.c
b/src/ldso/dynlink.c
index d2a72492e7212b45b4f3090c40f55a52728c780a..ec96be16dde2a5c69599012ec4ed140f2a8a9ed4 100644
(file)
--- a/
src/ldso/dynlink.c
+++ b/
src/ldso/dynlink.c
@@
-156,7
+156,7
@@
static uint32_t gnu_hash(const char *s0)
const unsigned char *s = (void *)s0;
uint_fast32_t h = 5381;
for (; *s; s++)
- h
= h*33
+ *s;
+ h
+= h*32
+ *s;
return h;
}