X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;ds=sidebyside;f=libmemcached%2Fencoding_key.cc;h=1e17d507a44b67b67756dcce0088d48283f17d43;hb=2eae87612891b9cd1920c4afa8515b208e12958d;hp=5888d4396e7d72d9d9065a5e7432cb3fc3dd5b0c;hpb=326e812b0ca940bf90aaadf69312a0316091d0cb;p=awesomized%2Flibmemcached diff --git a/libmemcached/encoding_key.cc b/libmemcached/encoding_key.cc index 5888d439..1e17d507 100644 --- a/libmemcached/encoding_key.cc +++ b/libmemcached/encoding_key.cc @@ -2,7 +2,7 @@ * * Libmemcached library * - * Copyright (C) 2011 Data Differential, http://datadifferential.com/ + * Copyright (C) 2011-2013 Data Differential, http://datadifferential.com/ * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -38,19 +38,19 @@ #include #include -static void _set_encoding_key(Memcached& self, const char *key, size_t key_length) +static void _set_encoding_key(Memcached& memc, const char *key, size_t key_length) { - hashkit_key(&self.hashkit, key, key_length); + hashkit_key(&memc.hashkit, key, key_length); } memcached_return_t memcached_set_encoding_key(memcached_st* shell, const char *key, size_t key_length) { - Memcached* self= memcached2Memcached(shell); - if (self == NULL) + Memcached* memc= memcached2Memcached(shell); + if (memc) { - return MEMCACHED_INVALID_ARGUMENTS; + _set_encoding_key(*memc, key, key_length); + return MEMCACHED_SUCCESS; } - _set_encoding_key(*self, key, key_length); - return MEMCACHED_SUCCESS; + return MEMCACHED_INVALID_ARGUMENTS; }