mvcc/index.go
func (ti *treeIndex) RangeSince(key, end []byte, rev int64) []revision {
	keyi := &keyIndex{key: key}

	ti.RLock()
	defer ti.RUnlock()

	if end == nil {
		item := ti.tree.Get(keyi)
		if item == nil {
			return nil
		}
		keyi = item.(*keyIndex)
		return keyi.since(ti.lg, rev)
	}

	endi := &keyIndex{key: end}
	var revs []revision
	ti.tree.AscendGreaterOrEqual(keyi, func(item btree.Item) bool {
		if len(endi.key) > 0 && !item.Less(endi) {
			return false
		}
		curKeyi := item.(*keyIndex)
		revs = append(revs, curKeyi.since(ti.lg, rev)...)
		return true
	})
	sort.Sort(revisions(revs))

	return revs
}
func (ti *treeIndex) RangeSince(key, end []byte, rev int64) []revision {
	keyi := &keyIndex{key: key}

	ti.RLock()
	defer ti.RUnlock()

	if end == nil {
		item := ti.tree.Get(keyi)
		if item == nil {
			return nil
		}
		keyi = item.(*keyIndex)
		return keyi.since(ti.lg, rev)
	}

	endi := &keyIndex{key: end}
	var revs []revision
	ti.tree.AscendGreaterOrEqual(keyi, func(item btree.Item) bool {
		if len(endi.key) > 0 && !item.Less(endi) {
			return false
		}
		curKeyi := item.(*keyIndex)
		revs = append(revs, curKeyi.since(ti.lg, rev)...)
		return true
	})
	sort.Sort(revisions(revs))

	return revs
}
func ( ti * treeIndex ) RangeSince ( key , end [ ] byte , rev int64 ) [ ] revision { keyi := & keyIndex { key : key } ti . RLock ( ) defer ti . RUnlock ( ) if end == nil { item := ti . tree . Get ( keyi ) if item == nil { return nil } keyi = item . ( * keyIndex ) return keyi . since ( ti . lg , rev ) } endi := & keyIndex { key : end } var revs [ ] revision ti . tree . AscendGreaterOrEqual ( keyi , func ( item btree . Item ) bool { if len ( endi . key ) > 0 && ! item . Less ( endi ) { return false } curKeyi := item . ( * keyIndex ) revs = append ( revs , curKeyi . since ( ti . lg , rev ) ... ) return true } ) sort . Sort ( revisions ( revs ) ) return revs }
// RangeSince returns all revisions from key(including) to end(excluding)
// at or after the given rev. The returned slice is sorted in the order
// of revision.
RangeSince returns all revisions from key ( including ) to end ( excluding ) at or after the given rev . The returned slice is sorted in the order of revision .