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

Function GraphIterator_Next

src/globals.c:311–330  ·  view source on GitHub ↗

advance iterator returns graph object in case iterator isn't depleted, otherwise returns NULL

Source from the content-addressed store, hash-verified

309// advance iterator
310// returns graph object in case iterator isn't depleted, otherwise returns NULL
311GraphContext *GraphIterator_Next
312(
313 KeySpaceGraphIterator *it // iterator to advance
314) {
315 ASSERT(it != NULL);
316
317 GraphContext *gc = NULL;
318
319 pthread_rwlock_rdlock(&_globals.lock);
320
321 if(it->idx < array_len(_globals.graphs_in_keyspace)) {
322 // prepare next call
323 gc = _globals.graphs_in_keyspace[it->idx++];
324 GraphContext_IncreaseRefCount(gc);
325 }
326
327 pthread_rwlock_unlock(&_globals.lock);
328
329 return gc;
330}
331

Callers 8

_CreateKeySpaceMetaKeysFunction · 0.85
_ClearKeySpaceMetaKeysFunction · 0.85
RG_ForkPrepareFunction · 0.85
RG_AfterForkParentFunction · 0.85
Graph_ListFunction · 0.85

Calls 2

array_lenFunction · 0.85

Tested by

no test coverage detected