remove redundant parenthesis and type conversion in flow controller

This commit is contained in:
Marten Seemann
2020-06-07 11:46:03 +07:00
parent 05514ab375
commit cea61e364d

View File

@@ -76,7 +76,7 @@ func (c *baseFlowController) AddBytesRead(n protocol.ByteCount) {
func (c *baseFlowController) hasWindowUpdate() bool { func (c *baseFlowController) hasWindowUpdate() bool {
bytesRemaining := c.receiveWindow - c.bytesRead bytesRemaining := c.receiveWindow - c.bytesRead
// update the window when more than the threshold was consumed // update the window when more than the threshold was consumed
return bytesRemaining <= protocol.ByteCount((float64(c.receiveWindowSize) * float64((1 - protocol.WindowUpdateThreshold)))) return bytesRemaining <= protocol.ByteCount(float64(c.receiveWindowSize)*(1-protocol.WindowUpdateThreshold))
} }
// getWindowUpdate updates the receive window, if necessary // getWindowUpdate updates the receive window, if necessary