mirror of
https://github.com/fluencelabs/redis
synced 2025-04-02 07:41:04 +00:00
added a comment to sdsMakeRoomFor() to make it clear what the function actually does.
This commit is contained in:
parent
ef23f3ac92
commit
3526724594
@ -101,6 +101,12 @@ void sdsclear(sds s) {
|
|||||||
sh->buf[0] = '\0';
|
sh->buf[0] = '\0';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Enlarge the free space at the end of the sds string so that the caller
|
||||||
|
* is sure that after calling this function can overwrite up to addlen
|
||||||
|
* bytes after the end of the string, plus one more byte for nul term.
|
||||||
|
*
|
||||||
|
* Note: this does not change the *size* of the sds string as returned
|
||||||
|
* by sdslen(), but only the free buffer space we have. */
|
||||||
static sds sdsMakeRoomFor(sds s, size_t addlen) {
|
static sds sdsMakeRoomFor(sds s, size_t addlen) {
|
||||||
struct sdshdr *sh, *newsh;
|
struct sdshdr *sh, *newsh;
|
||||||
size_t free = sdsavail(s);
|
size_t free = sdsavail(s);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user