Skip to content

Commit 51b28fd

Browse files
authored
Remove redundant type conversion. (alibaba#316)
* Remove redundant type conversion.
1 parent 3926f99 commit 51b28fd

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

core/hotspot/traffic_shaping.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ func (c *baseTrafficShapingController) performCheckingForConcurrencyMetric(arg i
9595
return base.NewTokenResultBlockedWithCause(base.BlockTypeHotSpotParamFlow,
9696
fmt.Sprintf("arg=%v", arg), c.BoundRule(), concurrency)
9797
}
98-
threshold := int64(c.threshold)
98+
threshold := c.threshold
9999
if concurrency <= threshold {
100100
return nil
101101
}
@@ -142,7 +142,7 @@ func (c *rejectTrafficShapingController) PerformChecking(arg interface{}, batchC
142142
}
143143

144144
// calculate available token
145-
tokenCount := int64(c.threshold)
145+
tokenCount := c.threshold
146146
val, existed := c.specificItems[arg]
147147
if existed {
148148
tokenCount = val
@@ -237,7 +237,7 @@ func (c *throttlingTrafficShapingController) PerformChecking(arg interface{}, ba
237237
}
238238

239239
// calculate available token
240-
tokenCount := int64(c.threshold)
240+
tokenCount := c.threshold
241241
val, existed := c.specificItems[arg]
242242
if existed {
243243
tokenCount = val

core/stat/base_node.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ func (n *BaseStatNode) GetMaxAvg(event base.MetricEvent) float64 {
5151
}
5252

5353
func (n *BaseStatNode) AddCount(event base.MetricEvent, count int64) {
54-
n.arr.AddCount(event, int64(count))
54+
n.arr.AddCount(event, count)
5555
}
5656

5757
func (n *BaseStatNode) AvgRT() float64 {

0 commit comments

Comments
 (0)