Skip to content

Commit

Permalink
Merge pull request #8648 from gyuho/mu
Browse files Browse the repository at this point in the history
mvcc: move 'keyi' define before holding locks
  • Loading branch information
gyuho committed Oct 5, 2017
2 parents 75a51f7 + 9154b31 commit 8b75689
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion mvcc/index.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 8b75689

Please sign in to comment.