From: Alexander Monakov Date: Sat, 27 Jun 2015 23:48:30 +0000 (+0300) Subject: dynlink.c: use a faster expression in gnu_hash X-Git-Url: http://nsz.repo.hu/git/?a=commitdiff_plain;h=66d45787c865a1807ae397a89a14699394ed4fa4;p=musl dynlink.c: use a faster expression in gnu_hash With -Os, GCC uses a multiply rather than a shift and addition for 'h*33'. Use a more efficient expression explicitely. --- diff --git a/src/ldso/dynlink.c b/src/ldso/dynlink.c index d2a72492..ec96be16 100644 --- 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; }