advance iterator returns graph object in case iterator isn't depleted, otherwise returns NULL
| 309 | // advance iterator |
| 310 | // returns graph object in case iterator isn't depleted, otherwise returns NULL |
| 311 | GraphContext *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 |
no test coverage detected