diff --git a/src/time/time.go b/src/time/time.go index 0d1cb9e5a153cd..7c0d429b0a7eef 100644 --- a/src/time/time.go +++ b/src/time/time.go @@ -252,7 +252,9 @@ func (t Time) Before(u Time) bool { if t.wall&u.wall&hasMonotonic != 0 { return t.ext < u.ext } - return t.sec() < u.sec() || t.sec() == u.sec() && t.nsec() < u.nsec() + ts := t.sec() + us := u.sec() + return ts < us || ts == us && t.nsec() < u.nsec() } // Equal reports whether t and u represent the same time instant.