MCPcopy Create free account
hub / github.com/RedisGraph/RedisGraph / sdsclear

Function sdsclear

src/util/sds/sds.c:195–198  ·  view source on GitHub ↗

Modify an sds string in-place to make it empty (zero length). * However all the existing buffer is not discarded but set as free space * so that next append operations will not require allocations up to the * number of bytes previously available. */

Source from the content-addressed store, hash-verified

193 * so that next append operations will not require allocations up to the
194 * number of bytes previously available. */
195void sdsclear(sds s) {
196 sdssetlen(s, 0);
197 s[0] = '\0';
198}
199
200/* Enlarge the free space at the end of the sds string so that the caller
201 * is sure that after calling this function can overwrite up to addlen

Callers 1

_ExecutionPlan_PrintFunction · 0.85

Calls 1

sdssetlenFunction · 0.85

Tested by

no test coverage detected