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

Function _JsonEncoder_Array

src/util/json_encoder.c:150–164  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

148}
149
150static sds _JsonEncoder_Array(SIValue list, sds s) {
151 // open array with "["
152 s = sdscat(s, "[");
153 uint arrayLen = SIArray_Length(list);
154 for(uint i = 0; i < arrayLen; i ++) {
155 // write the next value
156 s = _JsonEncoder_SIValue(SIArray_Get(list, i), s);
157 // if it is not the last element, add ", "
158 if(i != arrayLen - 1) s = sdscat(s, ", ");
159 }
160
161 // close array with "]"
162 s = sdscat(s, "]");
163 return s;
164}
165
166static sds _JsonEncoder_Map(SIValue map, sds s) {
167 ASSERT(SI_TYPE(map) & T_MAP);

Callers 1

_JsonEncoder_SIValueFunction · 0.85

Calls 4

sdscatFunction · 0.85
SIArray_LengthFunction · 0.85
_JsonEncoder_SIValueFunction · 0.85
SIArray_GetFunction · 0.85

Tested by

no test coverage detected