aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/proc.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/runtime/proc.go')
-rw-r--r--src/runtime/proc.go16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/runtime/proc.go b/src/runtime/proc.go
index d83b1bebf4..ae52826993 100644
--- a/src/runtime/proc.go
+++ b/src/runtime/proc.go
@@ -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 {