]> Cypherpunks repositories - gostls13.git/commitdiff
net: do not call time.Now() twice
authorRui Ueyama <ruiu@google.com>
Thu, 12 Jun 2014 03:33:44 +0000 (20:33 -0700)
committerRui Ueyama <ruiu@google.com>
Thu, 12 Jun 2014 03:33:44 +0000 (20:33 -0700)
LGTM=bradfitz
R=golang-codereviews, bradfitz
CC=golang-codereviews
https://golang.org/cl/104080043

src/pkg/net/hosts.go

index e6674ba3415a8be028fa47d1d733eb65b6271ddc..9400503e41eb373418507721b677b20062cbdc1d 100644 (file)
@@ -51,7 +51,7 @@ func readHosts() {
                        }
                }
                // Update the data cache.
-               hosts.expire = time.Now().Add(cacheMaxAge)
+               hosts.expire = now.Add(cacheMaxAge)
                hosts.path = hp
                hosts.byName = hs
                hosts.byAddr = is