Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ea081e0

Browse files
Use a more specific name for our 'slot caching enabled' define
1 parent 6ebb36c commit ea081e0

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

redis_cluster.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -372,14 +372,14 @@ static zend_string *cluster_hash_seeds(HashTable *ht) {
372372
return hash.s;
373373
}
374374

375-
#define CACHING_ENABLED() (INI_INT("redis.clusters.cache_slots") == 1)
375+
#define SLOT_CACHING_ENABLED() (INI_INT("redis.clusters.cache_slots") == 1)
376376
static redisCachedCluster *cluster_cache_load(HashTable *ht_seeds TSRMLS_DC) {
377377
zend_resource *le;
378378
zend_string *h;
379379

380380
/* Short circuit if we're not caching slots or if our seeds don't have any
381381
* elements, since it doesn't make sense to cache an empty string */
382-
if (!CACHING_ENABLED() || zend_hash_num_elements(ht_seeds) == 0)
382+
if (!SLOT_CACHING_ENABLED() || zend_hash_num_elements(ht_seeds) == 0)
383383
return NULL;
384384

385385
/* Look for cached slot information */
@@ -408,8 +408,8 @@ static int cluster_cache_store(HashTable *ht_seeds, HashTable *nodes TSRMLS_DC)
408408
zend_string *hash;
409409

410410
/* Short circuit if caching is disabled or there aren't any seeds */
411-
if (!CACHING_ENABLED() || zend_hash_num_elements(ht_seeds) == 0)
412-
return !CACHING_ENABLED() ? SUCCESS : FAILURE;
411+
if (!SLOT_CACHING_ENABLED() || zend_hash_num_elements(ht_seeds) == 0)
412+
return !SLOT_CACHING_ENABLED() ? SUCCESS : FAILURE;
413413

414414
/* Construct our cache */
415415
hash = cluster_hash_seeds(ht_seeds);

0 commit comments

Comments
 (0)