提交 66d45787 编写于 作者: A Alexander Monakov 提交者: Rich Felker

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.
上级 6ba5517a
......@@ -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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册