MCPcopy Create free account
hub / github.com/Soft/iter / Chain

Function Chain

iterator.go:372–377  ·  view source on GitHub ↗

Chain returns an Iterator that concatenates two iterators.

(first Iterator[T], second Iterator[T])

Source from the content-addressed store, hash-verified

370
371// Chain returns an Iterator that concatenates two iterators.
372func Chain[T any](first Iterator[T], second Iterator[T]) Iterator[T] {
373 return &chainIter[T]{
374 first: Fuse(first),
375 second: second,
376 }
377}
378
379func (it *chainIter[T]) Next() Option[T] {
380 v := it.first.Next()

Callers 1

TestChainFunction · 0.85

Calls 1

FuseFunction · 0.85

Tested by 1

TestChainFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…