Skip to content

Commit

Permalink
add comment (#997)
Browse files Browse the repository at this point in the history
  • Loading branch information
Connor1996 authored and nolouch committed Mar 21, 2018
1 parent 5a499bb commit 4af91bf
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions server/core/region_tree.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,12 @@ func (t *regionTree) length() int {
func (t *regionTree) update(region *metapb.Region) []*metapb.Region {
item := &regionItem{region: region}

// note that find() gets the first item equals or greater to the region
// in the case: |_______a_______|_____b_____|___c___|
// new region is |______d______|
// find() will return regionItem of region_a
// and both startKey of region_a and region_b are less than endKey of region_d,
// thus they are regarded as overlapped regions.
result := t.find(region)
if result == nil {
result = item
Expand Down

0 comments on commit 4af91bf

Please sign in to comment.