mvcc: move 'keyi' define before holding locks

To make it consistent with other code paths.

Signed-off-by: Gyu-Ho Lee <gyuhox@gmail.com>
release-3.3
Gyu-Ho Lee 2017-10-05 02:48:40 -07:00
parent 75a51f77f3
commit 9154b31bf3
1 changed files with 2 additions and 1 deletions

View File

@ -151,10 +151,11 @@ func (ti *treeIndex) Tombstone(key []byte, rev revision) error {
// at or after the given rev. The returned slice is sorted in the order
// of revision.
func (ti *treeIndex) RangeSince(key, end []byte, rev int64) []revision {
keyi := &keyIndex{key: key}
ti.RLock()
defer ti.RUnlock()
keyi := &keyIndex{key: key}
if end == nil {
item := ti.tree.Get(keyi)
if item == nil {