Skip to content

Commit

Permalink
sdsnative() removed: New rdb.c API can load native strings.
Browse files Browse the repository at this point in the history
  • Loading branch information
antirez committed Jan 8, 2015
1 parent f699b5e commit 32b1000
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 12 deletions.
11 changes: 0 additions & 11 deletions src/sds.c
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand Down
1 change: 0 additions & 1 deletion src/sds.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 32b1000

Please sign in to comment.