git://git.onelab.eu
/
sliver-openvswitch.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
revalidator: Fix ukey stats cache updating.
[sliver-openvswitch.git]
/
lib
/
jhash.c
diff --git
a/lib/jhash.c
b/lib/jhash.c
index
4ec2871
..
c59b51b
100644
(file)
--- a/
lib/jhash.c
+++ b/
lib/jhash.c
@@
-91,23
+91,23
@@
jhash_words(const uint32_t *p, size_t n, uint32_t basis)
/* Returns the Jenkins hash of the 'n' bytes at 'p', starting from 'basis'.
*
/* Returns the Jenkins hash of the 'n' bytes at 'p', starting from 'basis'.
*
- * Use
j
hash_bytes() instead, unless you're computing a hash function whose
+ * Use hash_bytes() instead, unless you're computing a hash function whose
* value is exposed "on the wire" so we don't want to change it. */
uint32_t
jhash_bytes(const void *p_, size_t n, uint32_t basis)
{
* value is exposed "on the wire" so we don't want to change it. */
uint32_t
jhash_bytes(const void *p_, size_t n, uint32_t basis)
{
- const uint
8
_t *p = p_;
+ const uint
32
_t *p = p_;
uint32_t a, b, c;
a = b = c = 0xdeadbeef + n + basis;
while (n >= 12) {
uint32_t a, b, c;
a = b = c = 0xdeadbeef + n + basis;
while (n >= 12) {
- a += get_unaligned_u32(
(uint32_t *)
p);
- b += get_unaligned_u32(
(uint32_t *) (p + 4)
);
- c += get_unaligned_u32(
(uint32_t *) (p + 8)
);
+ a += get_unaligned_u32(p);
+ b += get_unaligned_u32(
p + 1
);
+ c += get_unaligned_u32(
p + 2
);
jhash_mix(&a, &b, &c);
n -= 12;
jhash_mix(&a, &b, &c);
n -= 12;
- p +=
12
;
+ p +=
3
;
}
if (n) {
}
if (n) {