MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / moveToNextTask

Function moveToNextTask

deps/hiredis/read.c:241–267  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

239}
240
241static void moveToNextTask(redisReader *r) {
242 redisReadTask *cur, *prv;
243 while (r->ridx >= 0) {
244 /* Return a.s.a.p. when the stack is now empty. */
245 if (r->ridx == 0) {
246 r->ridx--;
247 return;
248 }
249
250 cur = r->task[r->ridx];
251 prv = r->task[r->ridx-1];
252 assert(prv->type == REDIS_REPLY_ARRAY ||
253 prv->type == REDIS_REPLY_MAP ||
254 prv->type == REDIS_REPLY_SET ||
255 prv->type == REDIS_REPLY_PUSH);
256 if (cur->idx == prv->elements-1) {
257 r->ridx--;
258 } else {
259 /* Reset the type because the next item can be anything */
260 assert(cur->idx < prv->elements);
261 cur->type = -1;
262 cur->elements = -1;
263 cur->idx++;
264 return;
265 }
266 }
267}
268
269static int processLineItem(redisReader *r) {
270 redisReadTask *cur = r->task[r->ridx];

Callers 3

processLineItemFunction · 0.85
processBulkItemFunction · 0.85
processAggregateItemFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected