Changes in kernel/generic/include/adt/hash.h [82cbf8c6:26d8df3] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/include/adt/hash.h
r82cbf8c6 r26d8df3 45 45 * Public domain. 46 46 */ 47 hash = ~hash + (hash << 15); 47 hash = ~hash + (hash << 15); 48 48 hash = hash ^ (hash >> 12); 49 49 hash = hash + (hash << 2); 50 50 hash = hash ^ (hash >> 4); 51 hash = hash * 2057; 51 hash = hash * 2057; 52 52 hash = hash ^ (hash >> 16); 53 return hash; 53 return hash; 54 54 } 55 55 … … 65 65 hash = hash ^ (hash >> 4); 66 66 hash = hash * 0x27d4eb2d; 67 hash = hash ^ (hash >> 15); 68 /* 67 hash = hash ^ (hash >> 15); 68 /* 69 69 * Lower order bits are mixed more thoroughly. Swap them with 70 70 * the higher order bits and make the resulting higher order bits … … 105 105 * http://burtleburtle.net/bob/c/lookup3.c 106 106 */ 107 seed ^= hash + 0x9e3779b9 107 seed ^= hash + 0x9e3779b9 108 108 + ((seed << 5) | (seed >> (sizeof(size_t) * 8 - 5))); 109 return seed; 109 return seed; 110 110 } 111 111
Note:
See TracChangeset
for help on using the changeset viewer.