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

Function EffectsBuffer_WriteSIArray

src/effects/effects.c:188–207  ·  view source on GitHub ↗

writes a binary representation of arr into Effect-Buffer

Source from the content-addressed store, hash-verified

186
187// writes a binary representation of arr into Effect-Buffer
188static void EffectsBuffer_WriteSIArray
189(
190 const SIValue *arr, // array
191 EffectsBuffer *buff // effect buffer
192) {
193 // format:
194 // number of elements
195 // elements
196
197 SIValue *elements = arr->array;
198 uint32_t len = array_len(elements);
199
200 // write number of elements
201 EffectsBuffer_WriteBytes(&len, sizeof(uint32_t), buff);
202
203 // write each element
204 for (uint32_t i = 0; i < len; i++) {
205 EffectsBuffer_WriteSIValue(elements + i, buff);
206 }
207}
208
209// dump attributes to stream
210static void EffectsBuffer_WriteAttributeSet

Callers 1

Calls 3

array_lenFunction · 0.85
EffectsBuffer_WriteBytesFunction · 0.85

Tested by

no test coverage detected