Skip to content

Commit

Permalink
lib/hash.h: fix hash_2words
Browse files Browse the repository at this point in the history
Number of bytes in 2 words should be 8, instead of 4 bytes,
to better follow the mhash_finish() API. It is unlikely the fix
will improve the quality of hashing results.

Signed-off-by: Andy Zhou <[email protected]>
Acked-by: Ben Pfaff <[email protected]>
  • Loading branch information
azhou-nicira committed Mar 28, 2014
1 parent a085dae commit 17041b1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/hash.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ static inline uint32_t hash_pointer(const void *p, uint32_t basis)

static inline uint32_t hash_2words(uint32_t x, uint32_t y)
{
return mhash_finish(mhash_add(mhash_add(x, 0), y), 4);
return mhash_finish(mhash_add(mhash_add(x, 0), y), 8);
}

#ifdef __cplusplus
Expand Down

0 comments on commit 17041b1

Please sign in to comment.