Skip to content

Commit

Permalink
*: clean code
Browse files Browse the repository at this point in the history
Signed-off-by: Weizhen Wang <[email protected]>
  • Loading branch information
hawkingrei committed Jan 30, 2024
1 parent 8925dd8 commit 7b4754a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion internal/locate/region_cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -1034,7 +1034,7 @@ func (l *KeyLocation) locateBucket(key []byte) *Bucket {

// buckets contains region's start/end key, so i==0 means it can't find a suitable bucket
// which can happen if the bucket information is stale.
if found || i == 0 ||
if !found || i == 0 ||
// the key isn't located in the last range.
(i == searchLen && len(keys[searchLen]) != 0 && bytes.Compare(key, keys[searchLen]) >= 0) {
return nil
Expand Down

0 comments on commit 7b4754a

Please sign in to comment.