summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorantirez <antirez@gmail.com>2013-03-06 12:34:43 +0100
committerantirez <antirez@gmail.com>2013-03-06 12:38:06 +0100
commit729a3432ba000c50fd6875600df62f4ef1a768ab (patch)
tree48bb8f5a2230df6ff81192e18be5e9435145bbc5
parentcf4d7737bb198af008c076a02d85acc22b380ef9 (diff)
downloadredis-729a3432ba000c50fd6875600df62f4ef1a768ab.tar.gz
sds.c: sdssplitargs_free() removed as it was a duplicate.
-rw-r--r--src/sds.c16
-rw-r--r--src/sds.h1
2 files changed, 5 insertions, 12 deletions
diff --git a/src/sds.c b/src/sds.c
index 7d1227e71..4cf700b9a 100644
--- a/src/sds.c
+++ b/src/sds.c
@@ -475,8 +475,10 @@ int hex_digit_to_int(char c) {
* foo bar "newline are supported\n" and "\xff\x00otherstuff"
*
* The number of arguments is stored into *argc, and an array
- * of sds is returned. The caller should sdsfree() all the returned
- * strings and finally zfree() the array itself.
+ * of sds is returned.
+ *
+ * The caller should free the resulting array of sds strings with
+ * sdsfreesplitres().
*
* Note that sdscatrepr() is able to convert back a string into
* a quoted string in the same format sdssplitargs() is able to parse.
@@ -581,8 +583,7 @@ sds *sdssplitargs(const char *line, int *argc) {
(*argc)++;
current = NULL;
} else {
- /* Even on empty input string returns something not NULL that
- * can be freed by sdssplitargs_free. */
+ /* Even on empty input string return something not NULL. */
if (vector == NULL) vector = zmalloc(sizeof(void*));
return vector;
}
@@ -597,13 +598,6 @@ err:
return NULL;
}
-void sdssplitargs_free(sds *argv, int argc) {
- int j;
-
- for (j = 0 ;j < argc; j++) sdsfree(argv[j]);
- zfree(argv);
-}
-
/* Modify the string substituting all the occurrences of the set of
* characters specified in the 'from' string to the corresponding character
* in the 'to' array.
diff --git a/src/sds.h b/src/sds.h
index e8d306503..c5a4f30a9 100644
--- a/src/sds.h
+++ b/src/sds.h
@@ -88,7 +88,6 @@ void sdstoupper(sds s);
sds sdsfromlonglong(long long value);
sds sdscatrepr(sds s, const char *p, size_t len);
sds *sdssplitargs(const char *line, int *argc);
-void sdssplitargs_free(sds *argv, int argc);
sds sdsmapchars(sds s, const char *from, const char *to, size_t setlen);
/* Low level functions exposed to the user API */