Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 8eb857b854
Fetching contributors…

Cannot retrieve contributors at this time

23 lines (18 sloc) 0.449 kb
package model
func NewLimitedIterator(iter Iterator, limit int) *LimitedIterator {
return &LimitedIterator{Iterator: iter, limit: limit}
}
///////////////////////////////////////////////////////////////////////////////
// LimitedIterator
type LimitedIterator struct {
Iterator
limit int
index int
}
func (self *LimitedIterator) Next() interface{} {
if self.index >= self.limit {
return nil
}
self.index++
return self.Iterator.Next()
}
Jump to Line
Something went wrong with that request. Please try again.