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

Function sdsjoin

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

Join an array of C strings using the specified separator (also a C string). * Returns the result as an sds string. */

Source from the content-addressed store, hash-verified

1134/* Join an array of C strings using the specified separator (also a C string).
1135 * Returns the result as an sds string. */
1136sds sdsjoin(char **argv, int argc, char *sep) {
1137 sds join = sdsempty();
1138 int j;
1139
1140 for (j = 0; j < argc; j++) {
1141 join = sdscat(join, argv[j]);
1142 if (j != argc-1) join = sdscat(join,sep);
1143 }
1144 return join;
1145}
1146
1147/* Like sdsjoin, but joins an array of SDS strings. */
1148sds sdsjoinsds(sds *argv, int argc, const char *sep, size_t seplen) {

Callers 2

configGetCommandFunction · 0.85
rewriteConfigBindOptionFunction · 0.85

Calls 2

sdsemptyFunction · 0.85
sdscatFunction · 0.85

Tested by

no test coverage detected