MCPcopy Create free account
hub / github.com/antirez/botlib / sdsjoin

Function sdsjoin

sds.c:1094–1103  ·  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

1092/* Join an array of C strings using the specified separator (also a C string).
1093 * Returns the result as an sds string. */
1094sds sdsjoin(char **argv, int argc, char *sep) {
1095 sds join = sdsempty();
1096 int j;
1097
1098 for (j = 0; j < argc; j++) {
1099 join = sdscat(join, argv[j]);
1100 if (j != argc-1) join = sdscat(join,sep);
1101 }
1102 return join;
1103}
1104
1105/* Like sdsjoin, but joins an array of SDS strings. */
1106sds sdsjoinsds(sds *argv, int argc, const char *sep, size_t seplen) {

Callers

nothing calls this directly

Calls 2

sdsemptyFunction · 0.85
sdscatFunction · 0.85

Tested by

no test coverage detected