Skip to content

Commit 21c46f4

Browse files
committed
time: move the nanosecond comparison before the rest in the Time == Time implementation
1 parent 083d3db commit 21c46f4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

vlib/time/operator.v

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ module time
33
// operator `==` returns true if provided time is equal to time
44
@[inline]
55
pub fn (t1 Time) == (t2 Time) bool {
6-
return t1.is_local == t2.is_local && t1.local_unix() == t2.local_unix()
7-
&& t1.nanosecond == t2.nanosecond
6+
return t1.nanosecond == t2.nanosecond && t1.is_local == t2.is_local
7+
&& t1.local_unix() == t2.local_unix()
88
}
99

1010
// operator `<` returns true if provided time is less than time

0 commit comments

Comments
 (0)