diff options
| author | Carlo Alberto Ferraris <cafxx@strayorange.com> | 2021-07-25 23:15:15 +0000 |
|---|---|---|
| committer | Austin Clements <austin@google.com> | 2021-09-02 13:52:06 +0000 |
| commit | a35c5c98c0487f93d70b468483f2ca8e0d698bb7 (patch) | |
| tree | 7cf7feeb47e2c359376519fcd53569948be48f1c /src/runtime | |
| parent | 90ed541149c781a96b86060a7618f73dcf347f28 (diff) | |
| download | go-a35c5c98c0487f93d70b468483f2ca8e0d698bb7.tar.xz | |
runtime: constify a test variable
Simple cleanup, no functionality change.
Change-Id: I8eceda4496a396e0117a0a601186c653982fb004
GitHub-Last-Rev: 58defc575e5834a3685bbb8179fdee4afa8d8fc7
GitHub-Pull-Request: golang/go#47389
Reviewed-on: https://go-review.googlesource.com/c/go/+/337289
Reviewed-by: Austin Clements <austin@google.com>
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Trust: Cherry Mui <cherryyz@google.com>
Diffstat (limited to 'src/runtime')
| -rw-r--r-- | src/runtime/export_test.go | 2 | ||||
| -rw-r--r-- | src/runtime/map_test.go | 2 | ||||
| -rw-r--r-- | src/runtime/stubs.go | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/src/runtime/export_test.go b/src/runtime/export_test.go index e7279564e3..01fd1dbd97 100644 --- a/src/runtime/export_test.go +++ b/src/runtime/export_test.go @@ -198,7 +198,7 @@ func MemclrBytes(b []byte) { memclrNoHeapPointers(s.array, uintptr(s.len)) } -var HashLoad = &hashLoad +const HashLoad = hashLoad // entry point for testing func GostringW(w []uint16) (s string) { diff --git a/src/runtime/map_test.go b/src/runtime/map_test.go index 24556b4093..f78cad5a77 100644 --- a/src/runtime/map_test.go +++ b/src/runtime/map_test.go @@ -473,7 +473,7 @@ func TestMapNanGrowIterator(t *testing.T) { nan := math.NaN() const nBuckets = 16 // To fill nBuckets buckets takes LOAD * nBuckets keys. - nKeys := int(nBuckets * *runtime.HashLoad) + nKeys := int(nBuckets * runtime.HashLoad) // Get map to full point with nan keys. for i := 0; i < nKeys; i++ { diff --git a/src/runtime/stubs.go b/src/runtime/stubs.go index 8a520d7839..c85b7d7330 100644 --- a/src/runtime/stubs.go +++ b/src/runtime/stubs.go @@ -119,7 +119,7 @@ func reflect_memmove(to, from unsafe.Pointer, n uintptr) { } // exported value for testing -var hashLoad = float32(loadFactorNum) / float32(loadFactorDen) +const hashLoad = float32(loadFactorNum) / float32(loadFactorDen) //go:nosplit func fastrand() uint32 { |
