From: Brian Aker Date: Tue, 19 Jan 2010 20:54:09 +0000 (-0800) Subject: Small cleanup for loop. X-Git-Tag: 0.40~80 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=118defb3246857a80d36ee1a8ee8b2b789fb6f09;p=awesomized%2Flibmemcached Small cleanup for loop. --- diff --git a/libhashkit/fnv.c b/libhashkit/fnv.c index fd171cef..c4ad0668 100644 --- a/libhashkit/fnv.c +++ b/libhashkit/fnv.c @@ -18,9 +18,8 @@ uint32_t hashkit_fnv1_64(const char *key, size_t key_length) { /* Thanks to pierre@demartines.com for the pointer */ uint64_t hash= FNV_64_INIT; - size_t x= 0; - for (x= 0; x < key_length; x++) + for (size_t x= 0; x < key_length; x++) { hash *= FNV_64_PRIME; hash ^= (uint64_t)key[x]; @@ -32,9 +31,8 @@ uint32_t hashkit_fnv1_64(const char *key, size_t key_length) uint32_t hashkit_fnv1a_64(const char *key, size_t key_length) { uint32_t hash= (uint32_t) FNV_64_INIT; - size_t x= 0; - for (x= 0; x < key_length; x++) + for (size_t x= 0; x < key_length; x++) { uint32_t val= (uint32_t)key[x]; hash ^= val; @@ -47,9 +45,8 @@ uint32_t hashkit_fnv1a_64(const char *key, size_t key_length) uint32_t hashkit_fnv1_32(const char *key, size_t key_length) { uint32_t hash= FNV_32_INIT; - size_t x= 0; - for (x= 0; x < key_length; x++) + for (size_t x= 0; x < key_length; x++) { uint32_t val= (uint32_t)key[x]; hash *= FNV_32_PRIME; @@ -62,9 +59,8 @@ uint32_t hashkit_fnv1_32(const char *key, size_t key_length) uint32_t hashkit_fnv1a_32(const char *key, size_t key_length) { uint32_t hash= FNV_32_INIT; - size_t x= 0; - for (x= 0; x < key_length; x++) + for (size_t x= 0; x < key_length; x++) { uint32_t val= (uint32_t)key[x]; hash ^= val;