]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: constify a test variable
authorCarlo Alberto Ferraris <cafxx@strayorange.com>
Sun, 25 Jul 2021 23:15:15 +0000 (23:15 +0000)
committerAustin Clements <austin@google.com>
Thu, 2 Sep 2021 13:52:06 +0000 (13:52 +0000)
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>

src/runtime/export_test.go
src/runtime/map_test.go
src/runtime/stubs.go

index e7279564e3fcaee92453d3e76dca1d5122e4695e..01fd1dbd97ebe81dbe31c3f19026fadad3f36f00 100644 (file)
@@ -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) {
index 24556b4093c32e44e8c2ab8e79e4a20422194bd0..f78cad5a776f4657f584fc622e09e7b55ee0cd63 100644 (file)
@@ -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++ {
index 8a520d7839e31e4fc7180f5e38b88be015c778e7..c85b7d7330e52078ad729f898e5524ee2e644b5c 100644 (file)
@@ -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 {