runtime: apply comments from CL 3742

I asked for this in CL 3742 and it was ignored.

Change-Id: I30ad05f87c7d9eccb11df7e19288e3ed2c7e2e3f
Reviewed-on: https://go-review.googlesource.com/6930
Reviewed-by: Dmitry Vyukov <dvyukov@google.com>
This commit is contained in:
Russ Cox 2015-03-05 09:52:41 -05:00
parent 12079acaa0
commit 84f53339be
2 changed files with 16 additions and 16 deletions

View file

@ -192,10 +192,10 @@ func acquireSudog() *sudog {
pp.sudogcache = append(pp.sudogcache, new(sudog))
}
}
ln := len(pp.sudogcache)
s := pp.sudogcache[ln-1]
pp.sudogcache[ln-1] = nil
pp.sudogcache = pp.sudogcache[:ln-1]
n := len(pp.sudogcache)
s := pp.sudogcache[n-1]
pp.sudogcache[n-1] = nil
pp.sudogcache = pp.sudogcache[:n-1]
if s.elem != nil {
throw("acquireSudog: found s.elem != nil in cache")
}
@ -230,10 +230,10 @@ func releaseSudog(s *sudog) {
// Transfer half of local cache to the central cache.
var first, last *sudog
for len(pp.sudogcache) > cap(pp.sudogcache)/2 {
ln := len(pp.sudogcache)
p := pp.sudogcache[ln-1]
pp.sudogcache[ln-1] = nil
pp.sudogcache = pp.sudogcache[:ln-1]
n := len(pp.sudogcache)
p := pp.sudogcache[n-1]
pp.sudogcache[n-1] = nil
pp.sudogcache = pp.sudogcache[:n-1]
if first == nil {
first = p
} else {