MCPcopy Create free account
hub / github.com/git/git / table_iter_next

Function table_iter_next

reftable/table.c:207–238  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

205}
206
207static int table_iter_next(struct table_iter *ti, struct reftable_record *rec)
208{
209 if (reftable_record_type(rec) != ti->typ)
210 return REFTABLE_API_ERROR;
211
212 while (1) {
213 int err;
214
215 if (ti->is_finished)
216 return 1;
217
218 /*
219 * Check whether the current block still has more records. If
220 * so, return it. If the iterator returns positive then the
221 * current block has been exhausted.
222 */
223 err = table_iter_next_in_block(ti, rec);
224 if (err <= 0)
225 return err;
226
227 /*
228 * Otherwise, we need to continue to the next block in the
229 * table and retry. If there are no more blocks then the
230 * iterator is drained.
231 */
232 err = table_iter_next_block(ti);
233 if (err) {
234 ti->is_finished = 1;
235 return err;
236 }
237 }
238}
239
240static int table_iter_seek_to(struct table_iter *ti, uint64_t off, uint8_t typ)
241{

Callers 2

table_iter_seek_indexedFunction · 0.85
table_iter_next_voidFunction · 0.85

Calls 3

reftable_record_typeFunction · 0.85
table_iter_next_in_blockFunction · 0.85
table_iter_next_blockFunction · 0.85

Tested by

no test coverage detected