modernize: run gopls modernize to bring up to 1.25 (#2920)
This commit is contained in:
parent
bfcd9d261d
commit
eec196d200
18 changed files with 78 additions and 116 deletions
|
|
@ -220,10 +220,12 @@ func DefaultBatcherWorkers() int {
|
|||
// DefaultBatcherWorkersFor returns the default number of batcher workers for a given CPU count.
|
||||
// Default to 3/4 of CPU cores, minimum 1, no maximum.
|
||||
func DefaultBatcherWorkersFor(cpuCount int) int {
|
||||
defaultWorkers := (cpuCount * 3) / 4
|
||||
if defaultWorkers < 1 {
|
||||
defaultWorkers = 1
|
||||
}
|
||||
const (
|
||||
workerNumerator = 3
|
||||
workerDenominator = 4
|
||||
)
|
||||
|
||||
defaultWorkers := max((cpuCount*workerNumerator)/workerDenominator, 1)
|
||||
|
||||
return defaultWorkers
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue