]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: gofmt all improperly formatted code
authorMichael Anthony Knyszek <mknyszek@google.com>
Fri, 9 Nov 2018 23:33:40 +0000 (23:33 +0000)
committerMichael Knyszek <mknyszek@google.com>
Sun, 11 Nov 2018 16:09:05 +0000 (16:09 +0000)
This change fixes incorrect formatting in mheap.go (the result of my
previous heap scavenging changes) and map_test.go.

Change-Id: I2963687504abdc4f0cdf2f0c558174b3bc0ed2df
Reviewed-on: https://go-review.googlesource.com/c/148977
Run-TryBot: Michael Knyszek <mknyszek@google.com>
Reviewed-by: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>

src/runtime/map_test.go
src/runtime/mheap.go

index 4713ce25ec533bcc1c80c147ea017c7db330c6e7..93b20668fa7038010571500314c3ca4cb1adb91b 100644 (file)
@@ -435,11 +435,11 @@ func TestEmptyKeyAndValue(t *testing.T) {
 // ("quick keys") as well as long keys.
 func TestSingleBucketMapStringKeys_DupLen(t *testing.T) {
        testMapLookups(t, map[string]string{
-               "x":    "x1val",
-               "xx":   "x2val",
-               "foo":  "fooval",
-               "bar":  "barval", // same key length as "foo"
-               "xxxx": "x4val",
+               "x":                      "x1val",
+               "xx":                     "x2val",
+               "foo":                    "fooval",
+               "bar":                    "barval", // same key length as "foo"
+               "xxxx":                   "x4val",
                strings.Repeat("x", 128): "longval1",
                strings.Repeat("y", 128): "longval2",
        })
index 9b121c63a1ca6a0d443f08fa4d35b67335dc2e8e..97a0448ad32d6f7935be1260b322f732012848ce 100644 (file)
@@ -903,7 +903,7 @@ HaveSpan:
                // If s was scavenged, then t may be scavenged.
                start, end := t.physPageBounds()
                if s.scavenged && start < end {
-                       memstats.heap_released += uint64(end-start)
+                       memstats.heap_released += uint64(end - start)
                        t.scavenged = true
                }
                s.state = mSpanManual // prevent coalescing with s
@@ -1146,7 +1146,7 @@ func (h *mheap) scavengeLargest(nbytes uintptr) {
                        //
                        // This check also preserves the invariant that spans that have
                        // `scavenged` set are only ever in the `scav` treap, and
-                       // those which have it unset are only in the `free` treap. 
+                       // those which have it unset are only in the `free` treap.
                        return
                }
                prev := t.pred()
@@ -1175,7 +1175,7 @@ func (h *mheap) scavengeAll(now, limit uint64) uintptr {
        for t != nil {
                s := t.spanKey
                next := t.succ()
-               if (now-uint64(s.unusedsince)) > limit {
+               if (now - uint64(s.unusedsince)) > limit {
                        r := s.scavenge()
                        if r != 0 {
                                // If we ended up scavenging s, then remove it from unscav