Update yatl.
[awesomized/libmemcached] / libmemcached / server_list.cc
index 537e9edd8dfb04e7817a22e369793b6072d8fc3d..b42a90953ce3c061bc591bc28a360ab9c20e47a5 100644 (file)
@@ -45,11 +45,11 @@ memcached_server_list_append_with_weight(memcached_server_list_st ptr,
                                          uint32_t weight,
                                          memcached_return_t *error)
 {
-  uint32_t count;
-
   memcached_return_t unused;
   if (error == NULL)
+  {
     error= &unused;
+  }
 
   if (hostname == NULL)
   {
@@ -60,14 +60,14 @@ memcached_server_list_append_with_weight(memcached_server_list_st ptr,
   {
     port = 0;
   }
-  else if (not port)
+  else if (port == 0)
   {
     port= MEMCACHED_DEFAULT_PORT;
   }
 
 
   /* Increment count for hosts */
-  count= 1;
+  uint32_t count= 1;
   if (ptr != NULL)
   {
     count+= memcached_server_list_count(ptr);
@@ -129,6 +129,7 @@ uint32_t memcached_instance_list_count(const memcached_st* self)
 
 void memcached_instance_set(memcached_st* memc, org::libmemcached::Instance* list, const uint32_t host_list_size)
 {
+  assert(memc);
   memc->servers= list;
   memc->number_of_hosts= host_list_size;
 }