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

Function SIValue_ConcatString

src/value.c:438–447  ·  view source on GitHub ↗

assumption: either a or b is a string

Source from the content-addressed store, hash-verified

436
437// assumption: either a or b is a string
438static SIValue SIValue_ConcatString(const SIValue a, const SIValue b) {
439 size_t bufferLen = 512;
440 size_t argument_len = 0;
441 char *buffer = rm_calloc(bufferLen, sizeof(char));
442 SIValue args[2] = {a, b};
443 SIValue_StringJoin(args, 2, "", &buffer, &bufferLen, &argument_len);
444 SIValue result = SI_DuplicateStringVal(buffer);
445 rm_free(buffer);
446 return result;
447}
448
449// assumption: either a or b is a list - static function, the caller validate types
450static SIValue SIValue_ConcatList(const SIValue a, const SIValue b) {

Callers 1

SIValue_AddFunction · 0.85

Calls 4

rm_callocFunction · 0.85
SIValue_StringJoinFunction · 0.85
SI_DuplicateStringValFunction · 0.85
rm_freeFunction · 0.85

Tested by

no test coverage detected