Skip to content

Commit 3a7a56c

Browse files
committed
runtime: gofmt all improperly formatted code
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 <[email protected]> Reviewed-by: Austin Clements <[email protected]> TryBot-Result: Gobot Gobot <[email protected]>
1 parent 8607b2e commit 3a7a56c

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

src/runtime/map_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -435,11 +435,11 @@ func TestEmptyKeyAndValue(t *testing.T) {
435435
// ("quick keys") as well as long keys.
436436
func TestSingleBucketMapStringKeys_DupLen(t *testing.T) {
437437
testMapLookups(t, map[string]string{
438-
"x": "x1val",
439-
"xx": "x2val",
440-
"foo": "fooval",
441-
"bar": "barval", // same key length as "foo"
442-
"xxxx": "x4val",
438+
"x": "x1val",
439+
"xx": "x2val",
440+
"foo": "fooval",
441+
"bar": "barval", // same key length as "foo"
442+
"xxxx": "x4val",
443443
strings.Repeat("x", 128): "longval1",
444444
strings.Repeat("y", 128): "longval2",
445445
})

src/runtime/mheap.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -903,7 +903,7 @@ HaveSpan:
903903
// If s was scavenged, then t may be scavenged.
904904
start, end := t.physPageBounds()
905905
if s.scavenged && start < end {
906-
memstats.heap_released += uint64(end-start)
906+
memstats.heap_released += uint64(end - start)
907907
t.scavenged = true
908908
}
909909
s.state = mSpanManual // prevent coalescing with s
@@ -1146,7 +1146,7 @@ func (h *mheap) scavengeLargest(nbytes uintptr) {
11461146
//
11471147
// This check also preserves the invariant that spans that have
11481148
// `scavenged` set are only ever in the `scav` treap, and
1149-
// those which have it unset are only in the `free` treap.
1149+
// those which have it unset are only in the `free` treap.
11501150
return
11511151
}
11521152
prev := t.pred()
@@ -1175,7 +1175,7 @@ func (h *mheap) scavengeAll(now, limit uint64) uintptr {
11751175
for t != nil {
11761176
s := t.spanKey
11771177
next := t.succ()
1178-
if (now-uint64(s.unusedsince)) > limit {
1178+
if (now - uint64(s.unusedsince)) > limit {
11791179
r := s.scavenge()
11801180
if r != 0 {
11811181
// If we ended up scavenging s, then remove it from unscav

0 commit comments

Comments
 (0)