From b4aaefe9a54dd25f1288c714ac13aaef8fc4fcd6 Mon Sep 17 00:00:00 2001 From: Brian Aker Date: Mon, 18 Jan 2010 11:42:24 -0800 Subject: [PATCH] Small style cleanup. --- libmemcached/auto.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/libmemcached/auto.c b/libmemcached/auto.c index 4fde5827..4d8cc0bd 100644 --- a/libmemcached/auto.c +++ b/libmemcached/auto.c @@ -11,7 +11,7 @@ #include "common.h" -static memcached_return_t memcached_auto(memcached_st *ptr, +static memcached_return_t text_incr_decr(memcached_st *ptr, const char *verb, const char *master_key, size_t master_key_length, const char *key, size_t key_length, @@ -160,7 +160,7 @@ memcached_return_t memcached_increment_by_key(memcached_st *ptr, } else { - rc= memcached_auto(ptr, "incr", master_key, master_key_length, key, key_length, offset, value); + rc= text_incr_decr(ptr, "incr", master_key, master_key_length, key, key_length, offset, value); } LIBMEMCACHED_MEMCACHED_INCREMENT_END(); @@ -180,12 +180,16 @@ memcached_return_t memcached_decrement_by_key(memcached_st *ptr, LIBMEMCACHED_MEMCACHED_DECREMENT_START(); if (ptr->flags.binary_protocol) + { rc= binary_incr_decr(ptr, PROTOCOL_BINARY_CMD_DECREMENT, master_key, master_key_length, key, key_length, (uint64_t)offset, 0, MEMCACHED_EXPIRATION_NOT_ADD, value); + } else - rc= memcached_auto(ptr, "decr", master_key, master_key_length, key, key_length, offset, value); + { + rc= text_incr_decr(ptr, "decr", master_key, master_key_length, key, key_length, offset, value); + } LIBMEMCACHED_MEMCACHED_DECREMENT_END(); -- 2.30.2