MCPcopy Create free account
hub / github.com/F-Stack/f-stack / sdsrange

Function sdsrange

app/redis-6.2.6/src/sds.c:798–807  ·  view source on GitHub ↗

Turn the string into a smaller (or equal) string containing only the * substring specified by the 'start' and 'end' indexes. * * start and end can be negative, where -1 means the last character of the * string, -2 the penultimate character, and so forth. * * The interval is inclusive, so the start and end characters will be part * of the resulting string. * * The string is modified in-pla

Source from the content-addressed store, hash-verified

796 * sdsrange(s,1,-1); => "ello World"
797 */
798void sdsrange(sds s, ssize_t start, ssize_t end) {
799 size_t newlen, len = sdslen(s);
800 if (len == 0) return;
801 if (start < 0)
802 start = len + start;
803 if (end < 0)
804 end = len + end;
805 newlen = (start > end) ? 0 : (end-start)+1;
806 sdssubstr(s, start, newlen);
807}
808
809/* Apply tolower() to every character of the sds string 's'. */
810void sdstolower(sds s) {

Callers 15

enumConfigSetFunction · 0.85
hintsCallbackFunction · 0.85
cliFormatReplyTTYFunction · 0.85
ldbLogWithMaxLenFunction · 0.85
ldbCatStackValueRecFunction · 0.85
sendBulkToSlaveFunction · 0.85
readHandlerFunction · 0.85
processMultibulkBufferFunction · 0.85
commandProcessedFunction · 0.85
processInputBufferFunction · 0.85
rioConnReadFunction · 0.85

Calls 2

sdslenFunction · 0.85
sdssubstrFunction · 0.85

Tested by

no test coverage detected