Skip to content

Commit e048bd7

Browse files
authored
flowcontrol: change variable names for better understanding (#8578)
This PR aims to improve some variable names for better understanding. Before the change, it took time for users to think about why there's a `b` variable. RELEASE NOTES: N/A Signed-off-by: Icarus Wu <[email protected]>
1 parent e350804 commit e048bd7

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

internal/transport/flowcontrol.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,9 @@ func (w *writeQuota) get(sz int32) error {
6767

6868
func (w *writeQuota) realReplenish(n int) {
6969
sz := int32(n)
70-
a := atomic.AddInt32(&w.quota, sz)
71-
b := a - sz
72-
if b <= 0 && a > 0 {
70+
newQuota := atomic.AddInt32(&w.quota, sz)
71+
previousQuota := newQuota - sz
72+
if previousQuota <= 0 && newQuota > 0 {
7373
select {
7474
case w.ch <- struct{}{}:
7575
default:

0 commit comments

Comments
 (0)