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.
This commit is contained in:
Alexander Monakov 2015-06-28 02:48:30 +03:00 committed by Rich Felker
parent 6ba5517a46
commit 66d45787c8
1 changed files with 1 additions and 1 deletions

View File

@ -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;
}