X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2Fhash.h;h=4f595bbb17e9417142c4e2e97be271e7767d16f3;hb=e9cad17338196026836b555dd971ba84ed011a9d;hp=1d3222bce05aaf147818469ae121f2b59431dfd2;hpb=2a817e5ea2c58e86bc897bc4a80a945ba8b3a9cc;p=platform%2Fupstream%2Flibsolv.git diff --git a/src/hash.h b/src/hash.h index 1d3222b..4f595bb 100644 --- a/src/hash.h +++ b/src/hash.h @@ -73,14 +73,14 @@ relhash(Id name, Id evr, int flags) /* compute bitmask for value - * returns smallest (2^n-1) > 2 * num - * + * returns smallest (2^n-1) > 2 * num + 3 + * * used for Hashtable 'modulo' operation - */ + */ static inline Hashval mkmask(unsigned int num) { - num *= 2; + num = num * 2 + 3; while (num & (num - 1)) num &= num - 1; return num * 2 - 1;