From: Brian Aker Date: Sat, 7 Jul 2012 11:44:46 +0000 (-0700) Subject: Removed dead param X-Git-Tag: 1.0.10~5^2~4 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=eff4858179d7883b92ab8682392357d104d5a8ab;p=awesomized%2Flibmemcached Removed dead param --- diff --git a/libmemcached/hosts.cc b/libmemcached/hosts.cc index dbfba007..2a07a395 100644 --- a/libmemcached/hosts.cc +++ b/libmemcached/hosts.cc @@ -62,10 +62,7 @@ static void sort_hosts(memcached_st *ptr) { if (memcached_server_count(ptr)) { - qsort(memcached_instance_list(ptr), memcached_server_count(ptr), sizeof(org::libmemcached::Instance), compare_servers); - org::libmemcached::Instance* instance= memcached_instance_fetch(ptr, 0); - instance->number_of_hosts= memcached_server_count(ptr); } } @@ -374,10 +371,6 @@ static memcached_return_t server_add(memcached_st *ptr, ptr->number_of_hosts++; - // @note we place the count in the bottom of the server list - instance= memcached_instance_fetch(ptr, 0); - memcached_instance_set_count(instance, memcached_server_count(ptr)); - return run_distribution(ptr); } @@ -424,12 +417,6 @@ memcached_return_t memcached_server_push(memcached_st *ptr, const memcached_serv ptr->number_of_hosts++; } - // Provides backwards compatibility with server list. - { - org::libmemcached::Instance* instance= memcached_instance_fetch(ptr, 0); - instance->number_of_hosts= memcached_server_count(ptr); - } - return run_distribution(ptr); } @@ -474,12 +461,6 @@ memcached_return_t memcached_instance_push(memcached_st *ptr, const struct org:: ptr->number_of_hosts++; } - // Provides backwards compatibility with server list. - { - org::libmemcached::Instance* instance= memcached_instance_fetch(ptr, 0); - instance->number_of_hosts= memcached_server_count(ptr); - } - return run_distribution(ptr); } diff --git a/libmemcached/instance.cc b/libmemcached/instance.cc index 01c514f1..aacdad64 100644 --- a/libmemcached/instance.cc +++ b/libmemcached/instance.cc @@ -44,7 +44,6 @@ static inline void _server_init(org::libmemcached::Instance* self, memcached_st { self->options.is_shutting_down= false; self->options.is_dead= false; - self->number_of_hosts= 0; self->cursor_active_= 0; self->port_= port; self->fd= INVALID_SOCKET; @@ -338,17 +337,6 @@ memcached_server_instance_st memcached_server_get_last_disconnect(const memcache return (memcached_server_instance_st)self->last_disconnected_server; } -uint32_t memcached_instance_set_count(org::libmemcached::Instance* servers, uint32_t count) -{ - WATCHPOINT_ASSERT(servers); - if (servers == NULL) - { - return 0; - } - - return servers->number_of_hosts= count; -} - const char *memcached_instance_name(const memcached_server_instance_st self) { WATCHPOINT_ASSERT(self); diff --git a/libmemcached/instance.h b/libmemcached/instance.h index c7539d80..6a56aa4c 100644 --- a/libmemcached/instance.h +++ b/libmemcached/instance.h @@ -95,7 +95,6 @@ struct Instance { bool is_shutting_down:1; bool is_dead:1; } options; - uint32_t number_of_hosts; uint32_t cursor_active_; in_port_t port_; memcached_socket_t fd; diff --git a/libmemcached/instance.hpp b/libmemcached/instance.hpp index a69b8ea3..1c614ab1 100644 --- a/libmemcached/instance.hpp +++ b/libmemcached/instance.hpp @@ -57,6 +57,4 @@ uint32_t memcached_instance_count(const memcached_st* self); uint32_t memcached_instance_response_count(const org::libmemcached::Instance* self); -uint32_t memcached_instance_set_count(org::libmemcached::Instance *servers, uint32_t count); - void __instance_free(org::libmemcached::Instance *);