Skip to content

Commit

Permalink
clean
Browse files Browse the repository at this point in the history
Signed-off-by: nolouch <[email protected]>
  • Loading branch information
nolouch committed Jun 2, 2021
1 parent 9400254 commit 57190b3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
10 changes: 5 additions & 5 deletions server/core/region_option.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,14 @@ func WithDownPeers(downPeers []*pdpb.PeerStats) RegionCreateOption {
}
}

// WithFlowBucketsWidth set the round step, which use to round to the Nearest number
// with the step.
func WithFlowBucketsWidth(bits uint64) RegionCreateOption {
// WithFlowBucketsWidth set the bucket width, which use to round to the nearest bucket
// with the with.
func WithFlowBucketsWidth(width uint64) RegionCreateOption {
return func(region *RegionInfo) {
if bits == 0 {
if width == 0 {
return
}
region.flowBucketsWidth = bits
region.flowBucketsWidth = width
}
}

Expand Down
8 changes: 4 additions & 4 deletions server/core/region_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,10 +163,10 @@ func (s *testRegionInfoSuite) TestRegionRoundingFlow(c *C) {
expect uint64
}{
{10, 0, 10},
{13, 1, 12},
{11807, 9, 11776},
{252623, 9, 252416},
{252623, 64, 0},
{13, 1, 13},
{11807, 512, 11776},
{252623, 512, 252416},
{252623, 10240, 245760},
{252623, math.MaxUint64, 0},
}
for _, t := range testcases {
Expand Down

0 comments on commit 57190b3

Please sign in to comment.