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

Function DropWhile

iterator.go:229–235  ·  view source on GitHub ↗

DropWhile returns an Iterator adapter that drops elements from the underlying Iterator until pred predicate function returns true.

(it Iterator[T], pred func(T) bool)

Source from the content-addressed store, hash-verified

227// DropWhile returns an Iterator adapter that drops elements from the underlying
228// Iterator until pred predicate function returns true.
229func DropWhile[T any](it Iterator[T], pred func(T) bool) Iterator[T] {
230 return &dropWhileIter[T]{
231 inner: it,
232 pred: pred,
233 done: false,
234 }
235}
236
237func (it *dropWhileIter[T]) Next() Option[T] {
238 if !it.done {

Callers 1

TestDropWhileFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestDropWhileFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…