MCPcopy
hub / github.com/cayleygraph/cayley / NextPath

Method NextPath

graph/sql/iterator.go:303–328  ·  view source on GitHub ↗
(ctx context.Context)

Source from the content-addressed store, hash-verified

301}
302
303func (it *iteratorNext) NextPath(ctx context.Context) bool {
304 if it.err != nil {
305 return false
306 }
307 if !it.query.nextPath {
308 return false
309 }
310 if !it.cursor.Next() {
311 it.err = it.cursor.Err()
312 it.cursor.Close()
313 return false
314 }
315 prev := it.res
316 if !it.scanValue(it.cursor) {
317 return false
318 }
319 if prev.Key() == it.res.Key() {
320 return true
321 }
322 // different main keys - return false, but keep this results for the Next
323 it.nextPathRes = it.res
324 it.nextPathTags = it.tags
325 it.res = nil
326 it.tags = nil
327 return false
328}
329
330func (it *iteratorNext) Close() error {
331 if it.cursor != nil {

Callers

nothing calls this directly

Calls 5

scanValueMethod · 0.80
NextMethod · 0.65
ErrMethod · 0.65
CloseMethod · 0.65
KeyMethod · 0.65

Tested by

no test coverage detected