summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorantirez <antirez@gmail.com>2015-01-07 10:25:31 +0100
committerantirez <antirez@gmail.com>2015-01-07 10:25:38 +0100
commitf56299023760603cb7cbf600e5487709e097964f (patch)
treec299de4880b6ab73430c73aee0fe12fa6c6eca73
parent0760c1f2f479ab012afdbe9021d85b02a2640f0b (diff)
downloadredis-f56299023760603cb7cbf600e5487709e097964f.tar.gz
sdsnative() removed: New rdb.c API can load native strings.
-rw-r--r--src/sds.c11
-rw-r--r--src/sds.h1
2 files changed, 0 insertions, 12 deletions
diff --git a/src/sds.c b/src/sds.c
index 3626dd524..05ee0ad56 100644
--- a/src/sds.c
+++ b/src/sds.c
@@ -88,17 +88,6 @@ void sdsfree(sds s) {
zfree(s-sizeof(struct sdshdr));
}
-/* Remove sds header so we can use buffer as malloc'd byte array.
- * Returns the contents of 's' usable as a full malloc'd C string. */
-char *sdsnative(sds s) {
- if (!s) return NULL;
-
- size_t len = sdslen(s);
- char *base = s-sizeof(struct sdshdr);
- memmove(base, s, len);
- return zrealloc(base, len);
-}
-
/* Set the sds string length to the length as obtained with strlen(), so
* considering as content only up to the first null term character.
*
diff --git a/src/sds.h b/src/sds.h
index 756ae0b53..93dd4f28e 100644
--- a/src/sds.h
+++ b/src/sds.h
@@ -60,7 +60,6 @@ sds sdsempty(void);
size_t sdslen(const sds s);
sds sdsdup(const sds s);
void sdsfree(sds s);
-char *sdsnative(sds s);
size_t sdsavail(const sds s);
sds sdsgrowzero(sds s, size_t len);
sds sdscatlen(sds s, const void *t, size_t len);