Skip to content
Browse files

Optimize setMulti()

  • Loading branch information...
1 parent 0e30553 commit c4b25424c10940da319f7bfc4df2460f7cb20f93 @iliaal iliaal committed Sep 27, 2011
Showing with 4 additions and 4 deletions.
  1. +4 −4 php_memcached.c
View
8 php_memcached.c
@@ -1212,12 +1212,12 @@ static void php_memc_setMulti_impl(INTERNAL_FUNCTION_PARAMETERS, zend_bool by_ke
RETURN_FALSE;
}
+retry:
if (!by_key) {
- server_key = str_key;
- server_key_len = str_key_len-1;
+ status = memcached_set(m_obj->memc, str_key, str_key_len-1, payload, payload_len, expiration, flags);
+ } else {
+ status = memcached_set_by_key(m_obj->memc, server_key, server_key_len, str_key, str_key_len-1, payload, payload_len, expiration, flags);
}
-retry:
- status = memcached_set_by_key(m_obj->memc, server_key, server_key_len, str_key, str_key_len-1, payload, payload_len, expiration, flags);
if (php_memc_handle_error(i_obj, status TSRMLS_CC) < 0) {
PHP_MEMC_FAILOVER_RETRY

0 comments on commit c4b2542

Please sign in to comment.
Something went wrong with that request. Please try again.