8000 Remove integer_length function · chenyongze/phpredis@6a74b95 · GitHub
[go: up one dir, main page]

Skip to content

Commit 6a74b95

Browse files
Remove integer_length function
1 parent f2d1ccf commit 6a74b95

File tree

2 files changed

+0
-17
lines changed

2 files changed

+0
-17
lines changed

library.c

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -540,22 +540,6 @@ redis_sock_read(RedisSock *redis_sock, int *buf_len TSRMLS_DC)
540540
return NULL;
541541
}
542542

543-
int
544-
integer_length(int i) {
545-
int sz = 0;
546-
int ci = abs(i);
547-
while (ci > 0) {
548-
ci /= 10;
549-
sz++;
550-
}
551-
if (i == 0) { /* log 0 doesn't make sense. */
552-
sz = 1;
553-
} else if (i < 0) { /* allow for neg sign as well. */
554-
sz++;
555-
}
556-
return sz;
557-
}
558-
559543
/* A simple union to store the various arg types we might handle in our
560544
* redis_spprintf command formatting function */
561545
union resparg {

library.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
#define REDIS_CMD_INIT_SSTR_STATIC(sstr, argc, keyword) \
1515
redis_cmd_init_sstr(sstr, argc, keyword, sizeof(keyword)-1);
1616

17-
int integer_length(int i);
1817
int redis_cmd_init_sstr(smart_string *str, int num_args, char *keyword, int keyword_len);
1918
int redis_cmd_append_sstr(smart_string *str, char *append, int append_len);
2019
int redis_cmd_append_sstr_int(smart_string *str, int append);

0 commit comments

Comments
 (0)
0