remove todo
Change-Id: I4b10d7a8c26bea9296b321f53abd0330f2afc35a
GitHub-Last-Rev:
b939acc2873a02687cdafc84894ab9a712d13a98
GitHub-Pull-Request: golang/go#74943
Reviewed-on: https://go-review.googlesource.com/c/go/+/694236
Auto-Submit: Michael Pratt <mpratt@google.com>
Reviewed-by: David Chase <drchase@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
import (
"internal/abi"
"internal/goarch"
+ "internal/runtime/math"
"unsafe"
)
// single-group tables, we could fill all slots.
return t.capacity - 1
} else {
- if t.capacity*maxAvgGroupLoad < t.capacity {
- // TODO(prattmic): Do something cleaner.
+ if t.capacity > math.MaxUint16/maxAvgGroupLoad {
panic("overflow")
}
return (t.capacity * maxAvgGroupLoad) / abi.MapGroupSlots
import "internal/goarch"
const (
+ MaxUint16 = ^uint16(0)
MaxUint32 = ^uint32(0)
MaxUint64 = ^uint64(0)
MaxUintptr = ^uintptr(0)