X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=libmemcached%2Fencoding_key.cc;h=1e17d507a44b67b67756dcce0088d48283f17d43;hb=d169e8c62f8ca4fe7d058d8e2254426105032b7e;hp=3472029ce6c8a2cd1a228a6f3388ce4b29e21f9c;hpb=983523c4536f12781533124cb8a00a4291b8cf79;p=awesomized%2Flibmemcached diff --git a/libmemcached/encoding_key.cc b/libmemcached/encoding_key.cc index 3472029c..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,18 +38,19 @@ #include #include -static void _set_encoding_key(memcached_st& 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* self, const char *key, size_t key_length) +memcached_return_t memcached_set_encoding_key(memcached_st* shell, const char *key, size_t key_length) { - 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; }