8000 Fix formatting issue, remove unneccisary variable · jrtkcoder/phpredis@5cbe1cf · GitHub
[go: up one dir, main page]

Skip to content

Commit 5cbe1cf

Browse files
Fix formatting issue, remove unneccisary variable
1 parent 51b9693 commit 5cbe1cf

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

redis.c

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2202,29 +2202,26 @@ PHP_METHOD(Redis, sRandMember)
22022202
zval *object;
22032203
RedisSock *redis_sock;
22042204
char *key = NULL, *cmd;
2205-
int key_len, cmd_len, key_free = 0, have_count = 0;
2205+
int key_len, cmd_len, key_free = 0;
22062206
long count;
22072207

22082208
// Parse our params
22092209
if(zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os|l",
22102210
&object, redis_ce, &key, &key_len, &count) == FAILURE) {
22112211
RETURN_FALSE;
2212-
}
2212+
}
22132213

22142214
// Get our redis socket
22152215
if(redis_sock_get(object, &redis_sock TSRMLS_CC, 0) < 0) {
22162216
RETURN_FALSE;
2217-
}
2217+
}
22182218

22192219
// Prefix our key if necissary
22202220
key_free = redis_key_prefix(redis_sock, &key, &key_len TSRMLS_CC);
22212221

2222-
// Do we have a count
2223-
have_count = ZEND_NUM_ARGS() == 2;
2224-
22252222
// If we have two arguments, we're running with an optional COUNT, which will return
22262223
// a multibulk reply. Without the argument we'll return a string response
2227-
if(have_count) {
2224+
if(ZEND_NUM_ARGS() == 2) {
22282225
// Construct our command with count
22292226
cmd_len = redis_cmd_format_static(&cmd, "SRANDMEMBER", "sl", key, key_len, count);
22302227
} else {

0 commit comments

Comments
 (0)
0