From 3e5a0dfc94bf55f8f8083ff5f49bc571993a07d9 Mon Sep 17 00:00:00 2001 From: Enzo Date: Wed, 3 Mar 2021 23:56:14 +0100 Subject: [PATCH] time: minor cleanup of operators (#9097) --- vlib/time/operator.v | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/vlib/time/operator.v b/vlib/time/operator.v index d4f13a82cb..7c6e616035 100644 --- a/vlib/time/operator.v +++ b/vlib/time/operator.v @@ -3,19 +3,13 @@ module time // operator `==` returns true if provided time is equal to time [inline] pub fn (t1 Time) == (t2 Time) bool { - if t1.unix == t2.unix && t1.microsecond == t2.microsecond { - return true - } - return false + return t1.unix == t2.unix && t1.microsecond == t2.microsecond } // operator `<` returns true if provided time is less than time [inline] pub fn (t1 Time) < (t2 Time) bool { - if t1.unix < t2.unix || (t1.unix == t2.unix && t1.microsecond < t2.microsecond) { - return true - } - return false + return t1.unix < t2.unix || (t1.unix == t2.unix && t1.microsecond < t2.microsecond) } // Time subtract using operator overloading.