Fixes condition where we were not correctly setting weighted vs not.
[awesomized/libmemcached] / libmemcached / behavior.cc
index 8ffbd665ec570ae29d76fddc7571d9804d6849fe..fe489cf231bd7f6f1ad1b72ff290e898eac89b62 100644 (file)
@@ -287,7 +287,7 @@ bool _is_auto_eject_host(const memcached_st *ptr)
 uint64_t memcached_behavior_get(memcached_st *ptr,
                                 const memcached_behavior_t flag)
 {
-  if (not ptr)
+  if (ptr == NULL)
   {
     return MEMCACHED_INVALID_ARGUMENTS;
   }
@@ -489,7 +489,7 @@ memcached_return_t memcached_behavior_set_distribution(memcached_st *ptr, memcac
 {
   if (type < MEMCACHED_DISTRIBUTION_CONSISTENT_MAX)
   {
-    if (MEMCACHED_DISTRIBUTION_CONSISTENT_WEIGHTED)
+    if (type == MEMCACHED_DISTRIBUTION_CONSISTENT_WEIGHTED)
     {
       ptr->ketama.weighted= true;
     }