*/
#include "libmemcached/common.h"
-
-#include <sys/time.h>
-
#include "libmemcached/virtual_bucket.h"
+#include "p9y/gettimeofday.hpp"
+#include "p9y/random.hpp"
uint32_t memcached_generate_hash_value(const char *key, size_t key_length,
memcached_hash_t hash_algorithm) {
right = begin;
return right->index;
}
- case MEMCACHED_DISTRIBUTION_MODULA: return hash % memcached_server_count(ptr);
- case MEMCACHED_DISTRIBUTION_RANDOM: return (uint32_t) random() % memcached_server_count(ptr);
+ case MEMCACHED_DISTRIBUTION_MODULA:
+ return hash % memcached_server_count(ptr);
+ case MEMCACHED_DISTRIBUTION_RANDOM:
+ return (uint32_t) random() % memcached_server_count(ptr);
case MEMCACHED_DISTRIBUTION_VIRTUAL_BUCKET: {
return memcached_virtual_bucket_get(ptr, hash);
}