]> Cypherpunks repositories - gostls13.git/commitdiff
time: Remove unnecessary call to Nanoseconds() in after().
authorKyle Consalus <consalus@gmail.com>
Mon, 23 May 2011 19:38:51 +0000 (12:38 -0700)
committerBrad Fitzpatrick <bradfitz@golang.org>
Mon, 23 May 2011 19:38:51 +0000 (12:38 -0700)
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/4528091

src/pkg/time/sleep.go

index 3bc253c94a3908c891bdd6da4bb9093fa68f7d18..314622d0dc9997f48ac629ad228215c1dc0a522e 100644 (file)
@@ -91,7 +91,7 @@ func (e *Timer) Stop() (ok bool) {
 // It assumes that f will not block.
 func after(ns int64, f func(int64)) (e *Timer) {
        now := Nanoseconds()
-       t := Nanoseconds() + ns
+       t := now + ns
        if ns > 0 && t < now {
                panic("time: time overflow")
        }