code: func (c *RegionCache) searchCachedRegion(key []byte, isEndKey bool) *Region {
  	var r *Region
  	c.mu.sorted.DescendLessOrEqual(newBtreeSearchItem(key), func(item btree.Item) bool {
  		r = item.(*btreeItem).region
  		if isEndKey && bytes.Equal(r.StartKey(), key) {
  			r = nil     // clear result
  			return true // iterate next item
  		}
  		return false
  	})
  	if r != nil && (!isEndKey && r.Contains(key) || isEndKey && r.ContainsByEnd(key)) {
  		return c.getCachedRegion(r.VerID())
  	}
  	return nil
  }
docs: // searchCachedRegion finds a region from cache by key. Like `getCachedRegion`,
  // it should be called with c.mu.RLock(), and the returned Region should not be
  // used after c.mu is RUnlock().
  // If the given key is the end key of the region that you want, you may set the second argument to true. This is useful when processing in reverse order.