Skip to content

Commit 3b87da6

Browse files
Remove unused vars, commented code for HINCRBYFLOAT
1 parent 24c1023 commit 3b87da6

File tree

2 files changed

+3
-24
lines changed

2 files changed

+3
-24
lines changed

redis.c

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -4545,9 +4545,8 @@ PHP_METHOD(Redis, hIncrByFloat)
45454545
zval *object;
45464546
RedisSock *redis_sock;
45474547
char *key = NULL, *cmd, *member;
4548-
int key_len, member_len, cmd_len, val_len, key_free;
4548+
int key_len, member_len, cmd_len, key_free;
45494549
double val;
4550-
int i, dcount;
45514550

45524551
// Validate we have the right number of arguments
45534552
if(zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Ossd",
@@ -4561,27 +4560,6 @@ PHP_METHOD(Redis, hIncrByFloat)
45614560
RETURN_FALSE;
45624561
}
45634562

4564-
// Start at the begining unless the first character is '-'
4565-
/*i = val_len && val[0] == '-' ? 1 : 0;
4566-
4567-
// Initially we have no '.' characters
4568-
dcount = 0;
4569-
4570-
// Iterate our string
4571-
for(; i<val_len; ++i) {
4572-
// Increment our decimal count and skip this iteration if we're on one
4573-
if(val[i] == '.') {
4574-
++dcount;
4575-
continue;
4576-
}
4577-
4578-
// We're invalid if this character isn't numeric, or if we have too many decimals
4579-
if((val[i] < '0' || val[i] > '9') || dcount > 1) {
4580-
RETURN_FALSE;
4581-
}
4582-
}
4583-
*/
4584-
45854563
key_free = redis_key_prefix(redis_sock, &key, &key_len TSRMLS_CC);
45864564
cmd_len = redis_cmd_format_static(&cmd, "HINCRBYFLOAT", "ssf", key, key_len, member, member_len, val);
45874565
if(key_free) efree(key);

tests/TestRedis.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1853,7 +1853,7 @@ public function testZX() {
18531853
$this->redis->delete('z');
18541854
$this->redis->zadd('z', 1, 'one');
18551855
$this->redis->zadd('z', 2, 'two');
1856-
$this->redis->zadd('z', 5, 'five');
1856+
$this->redis->zadd('z', 5, 'five');
18571857

18581858
$this->assertTrue(0 === $this->redis->zRank('z', 'one'));
18591859
$this->assertTrue(1 === $this->redis->zRank('z', 'two'));
@@ -1862,6 +1862,7 @@ public function testZX() {
18621862
$this->assertTrue(2 === $this->redis->zRevRank('z', 'one'));
18631863
$this->assertTrue(1 === $this->redis->zRevRank('z', 'two'));
18641864
$this->assertTrue(0 === $this->redis->zRevRank('z', 'five'));
1865+
18651866
}
18661867

18671868
public function testHashes() {

0 commit comments

Comments
 (0)