Like sdsjoin, but joins an array of SDS strings. */
| 1146 | |
| 1147 | /* Like sdsjoin, but joins an array of SDS strings. */ |
| 1148 | sds sdsjoinsds(sds *argv, int argc, const char *sep, size_t seplen) { |
| 1149 | sds join = sdsempty(); |
| 1150 | int j; |
| 1151 | |
| 1152 | for (j = 0; j < argc; j++) { |
| 1153 | join = sdscatsds(join, argv[j]); |
| 1154 | if (j != argc-1) join = sdscatlen(join,sep,seplen); |
| 1155 | } |
| 1156 | return join; |
| 1157 | } |
| 1158 | |
| 1159 | /* Wrappers to the allocators used by SDS. Note that SDS will actually |
| 1160 | * just use the macros defined into sdsalloc.h in order to avoid to pay |