// Next returns next iterator. Return io.EOF if no more key/value pair is
// available.
//
// Note: We used named returns because of an unexpected performance improvement
// See https://github.com/golang/go/issues/40638
Next returns next iterator. Return io.EOF if no more key/value pair is
available.


// Next returns next iterator . Return io . EOF if no more key / value pair is // available . // // Note : We used named returns because of an unexpected performance improvement // See https : // github . com / golang / go / issues / 40638
func (i KeyValIterator) Next() (kv KeyValIterator, _ error) {
	if i.leftPairCount <= 0 {
		return KeyValIterator{}, io.EOF
	}
	rbuf := typed.NewReadBuffer(i.remaining)
	keyLen := int(rbuf.ReadUint16())
	key := rbuf.ReadBytes(keyLen)
	valLen := int(rbuf.ReadUint16())
	val := rbuf.ReadBytes(valLen)
	if rbuf.Err() != nil {
		return KeyValIterator{}, rbuf.Err()
	}
	leftPairCount := i.leftPairCount - 1
	kv = KeyValIterator{
		remaining:     rbuf.Remaining(),
		leftPairCount: leftPairCount,
		key:           key,
		val:           val,
	}
	return kv, nil
}
func ( i KeyValIterator ) Next ( ) ( kv KeyValIterator , _ error ) { if i . leftPairCount <= 0 { return KeyValIterator { } , io . EOF } rbuf := typed . NewReadBuffer ( i . remaining ) keyLen := int ( rbuf . ReadUint16 ( ) ) key := rbuf . ReadBytes ( keyLen ) valLen := int ( rbuf . ReadUint16 ( ) ) val := rbuf . ReadBytes ( valLen ) if rbuf . Err ( ) != nil { return KeyValIterator { } , rbuf . Err ( ) } leftPairCount := i . leftPairCount - 1 kv = KeyValIterator { remaining : rbuf . Remaining ( ) , leftPairCount : leftPairCount , key : key , val : val , } return kv , nil }
Next returns next iterator.
Next returns next iterator .