summaryrefslogtreecommitdiff
path: root/libgo/go/time/time.go
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2013-01-18 12:34:11 -0800
committerH.J. Lu <hjl.tools@gmail.com>2013-01-18 12:34:11 -0800
commit43269d882367dc4f0e4c2651d6625e1b7de78764 (patch)
tree6aaf525a6fb8a4fb63a71c9ca56be58bc1d6655b /libgo/go/time/time.go
parentce97ec0e268b7b50b9f801dd12ffc67042c47193 (diff)
parent48dc1117de124a2265129a36bfbbc211522c2c02 (diff)
downloadgcc-hjl/tsx/gcc-4_7-branch.tar.gz
Merge remote-tracking branch 'origin/gcc-4_7-branch' into hjl/tsx/gcc-4_7-branchhjl/tsx/gcc-4_7-branch
Conflicts: gcc/config/i386/driver-i386.c gcc/config/i386/i386.c gcc/config/i386/sync.md
Diffstat (limited to 'libgo/go/time/time.go')
-rw-r--r--libgo/go/time/time.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/libgo/go/time/time.go b/libgo/go/time/time.go
index 2461dac06f5..d48ca0c269e 100644
--- a/libgo/go/time/time.go
+++ b/libgo/go/time/time.go
@@ -241,10 +241,10 @@ func (t Time) IsZero() bool {
// It is called when computing a presentation property like Month or Hour.
func (t Time) abs() uint64 {
l := t.loc
- if l == nil {
- l = &utcLoc
+ // Avoid function calls when possible.
+ if l == nil || l == &localLoc {
+ l = l.get()
}
- // Avoid function call if we hit the local time cache.
sec := t.sec + internalToUnix
if l != &utcLoc {
if l.cacheZone != nil && l.cacheStart <= sec && sec < l.cacheEnd {