fix(util/hash): relax pre-condition

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
This commit is contained in:
Leonardo de Moura 2014-07-02 09:56:50 -07:00
parent f464775af6
commit 8b8881deae

View file

@ -23,7 +23,8 @@ inline unsigned hash(unsigned h1, unsigned h2) {
template<typename H>
unsigned hash(unsigned n, H h, unsigned init_value = 31) {
unsigned a, b, c;
lean_assert(n > 0);
if (n == 0)
return init_value;
a = b = 0x9e3779b9;
c = 11;