Skip to content

Commit

Permalink
refactor: recorrected the comment for max buffer formula used
Browse files Browse the repository at this point in the history
  • Loading branch information
Yashk767 committed Sep 3, 2024
1 parent 3a0c659 commit 05214b6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cmd/config-utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@ func calculateMaxBufferPercent(stateBuffer, stateLength uint64) int32 {
}

// The formula is derived from the condition:
// 2(maxBuffer % stateBuffer) < (stateLength - 2*StateBuffer)
// 2(maxBuffer % stateLength) < (stateLength - 2*StateBuffer)

// Perform the calculation with float64 for precision
maxBufferPercent := 50 * (1 - (float64(2*stateBuffer) / float64(stateLength)))
Expand Down

0 comments on commit 05214b6

Please sign in to comment.