Skip to content

Commit 5d35acd

Browse files
Remove redis_cmd_append_str and redis_cmd_append_int
1 parent 0970dde commit 5d35acd

File tree

2 files changed

+0
-43
lines changed

2 files changed

+0
-43
lines changed

library.c

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -722,33 +722,6 @@ redis_cmd_format_static(char **ret, char *keyword, char *format, ...)
722722
return buf.len;
723723
}
724724

725-
/*
726-
* Append a command sequence to a Redis command
727-
*/
728-
int redis_cmd_append_str(char **cmd, int cmd_len, char *append, int append_len) {
729-
/* Smart string buffer */
730-
smart_string buf = {0};
731-
732-
/* Append the current command to our smart_string */
733-
smart_string_appendl(&buf, *cmd, cmd_len);
734-
735-
/* Append our new command sequence */
736-
smart_string_appendc(&buf, '$');
737-
smart_string_append_long(&buf, append_len);
738-
smart_string_appendl(&buf, _NL, sizeof(_NL) -1);
739-
smart_string_appendl(&buf, append, append_len);
740-
smart_string_appendl(&buf, _NL, sizeof(_NL) -1);
741-
742-
/* Free our old command */
743-
efree(*cmd);
744-
745-
/* Set our return pointer */
746-
*cmd = buf.c;
747-
748-
/* Return new command length */
749-
return buf.len;
750-
}
751-
752725
/*
753726
* Given a smart string, number of arguments, a keyword, and the length of the keyword
754727
* initialize our smart string with the proper Redis header for the command to follow
@@ -843,20 +816,6 @@ int redis_cmd_append_sstr_key(smart_string *str, char *key, strlen_t len, RedisS
843816
return retval;
844817
}
845818

846-
/*
847-
* Append an integer command to a Redis command
848-
*/
849-
int redis_cmd_append_int(char **cmd, int cmd_len, int append) {
850-
char int_buf[32];
851-
int int_len;
852-
853-
// Conver to an int, capture length
854-
int_len = snprintf(int_buf, sizeof(int_buf), "%d", append);
855-
856-
/* Return the new length */
857-
return redis_cmd_append_str(cmd, cmd_len, int_buf, int_len);
858-
}
859-
860819
PHP_REDIS_API void redis_bulk_double_response(INTERNAL_FUNCTION_PARAMETERS, RedisSock *redis_sock, zval *z_tab, void *ctx) {
861820

862821
char *response;

library.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,10 @@
1515

1616
int integer_length(int i);
1717
int redis_cmd_format_static(char **ret, char *keyword, char *format, ...);
18-
int redis_cmd_append_str(char **cmd, int cmd_len, char *append, int append_len);
1918
int redis_cmd_init_sstr(smart_string *str, int num_args, char *keyword, int keyword_len);
2019
int redis_cmd_append_sstr(smart_string *str, char *append, int append_len);
2120
int redis_cmd_append_sstr_int(smart_string *str, int append);
2221
int redis_cmd_append_sstr_long(smart_string *str, long append);
23-
int redis_cmd_append_int(char **cmd, int cmd_len, int append);
2422
int redis_cmd_append_sstr_dbl(smart_string *str, double value);
2523
int redis_cmd_append_sstr_zval(smart_string *str, zval *z, RedisSock *redis_sock TSRMLS_DC);
2624
int redis_cmd_append_sstr_key(smart_string *str, char *key, strlen_t len, RedisSock *redis_sock, short *slot);

0 commit comments

Comments
 (0)