// Next turns to the next position on c.
// It returns nil at the end on c.
498483
func (c *Cursor) Next() *Position {
	n := c.curr.cmp(&c.end)
	if n == 0 {
		if c.pi == len(c.ps)-1 {
			return nil
		}
		c.pi++
		c.curr = ipToIPv6Int(c.ps[c.pi].IP.To16())
		c.start = c.curr
		if c.ps[c.pi].IP.To4() != nil {
			c.end = c.ps[c.pi].lastIPv4MappedIPv6Int()
		}
		if c.ps[c.pi].IP.To16() != nil && c.ps[c.pi].IP.To4() == nil {
			c.end = c.ps[c.pi].lastIPv6Int()
		}
	} else {
		c.curr.incr()
	}
	return c.Pos()
}
120265
func (rItr *reverseIterator) Next() {
	var err error
	rItr.cur, err = rItr.dric.Recv()
	if err != nil {
		panic(fmt.Sprintf("RemoteDB.ReverseIterator.Next error: %v", err))
	}
}
124873
func (i *Uint16) Next() uint16 {
	i.lock.Lock()
	defer i.lock.Unlock()
	i.increment++
	return i.increment
}
429883
func (r *charIter) next() (byte, byte, bool) {
	// we have reached the last string in the index, end
	if r.isEnd() {
		return 0, 0, false
	}

	b := r.seq[r.si][r.i]
	sep := r.sep[r.si]
	r.i++

	// current string index exceeded the last char of the current string
	// move to the next string if it's present
	if r.i >= len(r.seq[r.si]) && r.si < len(r.seq)-1 {
		r.si++
		r.i = 0
	}

	return b, sep, true
}
1144535
func (it *iterator4RowPtr) Next() Row {
	if len := it.Len(); it.cursor >= len {
		it.cursor = len + 1
		return it.End()
	}
	row := it.li.GetRow(it.ptrs[it.cursor])
	it.cursor++
	return row
}
1286553
func (e *element) Next() *element {
	if p := e.next; e.list != nil && p != &e.list.root {
		return p
	}
	return nil
}
690989
func (i *Uint) Next() uint {
	i.lock.Lock()
	defer i.lock.Unlock()
	i.increment++
	return i.increment
}
787724
func (ri *runIterator16) next() uint16 {
	if !ri.hasNext() {
		panic("no Next available")
	}
	if ri.curIndex >= int64(len(ri.rc.iv)) {
		panic("runIterator.Next() going beyond what is available")
	}
	if ri.curIndex == -1 {
		// first time is special
		ri.curIndex = 0
	} else {
		ri.curPosInIndex++
		if int64(ri.rc.iv[ri.curIndex].start)+int64(ri.curPosInIndex) == int64(ri.rc.iv[ri.curIndex].last())+1 {
			ri.curPosInIndex = 0
			ri.curIndex++
		}
		ri.curSeq++
	}
	return ri.cur()
}
749856
func (it *ReaderIteratorImpl) Next() (v int64, err error) {
	nextValues, err := it.nextN(1)
	if err != nil {
		return 0, err
	}
	assert(len(nextValues) > 0)
	return nextValues[0], nil
}
67898
func (i *Uint32) Next() uint32 {
	i.lock.Lock()
	defer i.lock.Unlock()
	i.increment++
	return i.increment
}
1305535
func (c *Cursor) next() (key []byte, value []byte, flags uint32) {
	for {
		// Attempt to move over one element until we're successful.
		// Move up the stack as we hit the end of each page in our stack.
		var i int
		for i = len(c.stack) - 1; i >= 0; i-- {
			elem := &c.stack[i]
			if elem.index < elem.count()-1 {
				elem.index++
				break
			}
		}

		// If we've hit the root page then stop and return. This will leave the
		// cursor on the last element of the last page.
		if i == -1 {
			return nil, nil, 0
		}

		// Otherwise start from where we left off in the stack and find the
		// first element of the first leaf page.
		c.stack = c.stack[:i+1]
		c.first()

		// If this is an empty page then restart and move back up the stack.
		// https://github.com/boltdb/bolt/issues/450
		if c.stack[len(c.stack)-1].count() == 0 {
			continue
		}

		return c.keyValue()
	}
}
1334372
func (it *Iter) Next() bool {
	if len(it.values) == 0 && it.meta.HasMore && !it.listParams.Single {
		// determine if we're moving forward or backwards in paging
		if it.listParams.EndingBefore != nil {
			it.listParams.EndingBefore = String(listItemID(it.cur))
			it.formValues.Set(EndingBefore, *it.listParams.EndingBefore)
		} else {
			it.listParams.StartingAfter = String(listItemID(it.cur))
			it.formValues.Set(StartingAfter, *it.listParams.StartingAfter)
		}
		it.getPage()
	}
	if len(it.values) == 0 {
		return false
	}
	it.cur = it.values[0]
	it.values = it.values[1:]
	return true
}
471042
func (pd *DocumentIterator) Next(d Document) error {
	pd.loadInternal()

	hasNext := pd.iterator.Next(d)
	if hasNext {
		return nil
	}
	return pd.iterator.Err()
}
811895
func (iter *sliceIterator) next() (string, string, int) {
	if iter.position > len(iter.slice)-1 {
		return "", "", -1
	}
	position := iter.position
	iter.position++
	return iter.slice[position], strings.Trim(iter.slice[position], " \t"), position
}
797232
func (a actions) next(r, c interface{}) (interface{}, error) {
	return a[0](r, c, a[1:])
}
142990
func (c *KeyCursor) Next() {
	if len(c.current) == 0 {
		return
	}
	// Do we still have unread values in the current block
	if !c.current[0].read() {
		return
	}
	c.current = c.current[:0]
	if c.ascending {
		c.nextAscending()
	} else {
		c.nextDescending()
	}
}
249946
func (it *iterator) Next() bool {
	// If the iterator was not yet initialized, do it now
	if !it.inited {
		it.inited = true
		return len(it.keys) > 0
	}
	// Iterator already initialize, advance it
	if len(it.keys) > 0 {
		it.keys = it.keys[1:]
		it.values = it.values[1:]
	}
	return len(it.keys) > 0
}