From 6df08df509f729ec5f2197c53e0ed363091f8e84 Mon Sep 17 00:00:00 2001 From: Roxie Gibson Date: Thu, 12 Aug 2021 14:44:49 +0100 Subject: [PATCH] style(tagcmp): simplify returns --- tagcmp/tagcmp.go | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/tagcmp/tagcmp.go b/tagcmp/tagcmp.go index 55d248e32..430d85e04 100644 --- a/tagcmp/tagcmp.go +++ b/tagcmp/tagcmp.go @@ -74,11 +74,7 @@ func (t Tag) IsGreaterThan(tag Tag) bool { // take into account here, shorter is bigger (i.e. 2.1 < 2.1.1 == false, 2 < // 2.1 == false). func (t Tag) IsLessThan(tag Tag) bool { - if t.IsGreaterThan(tag) { - return false - } - - return true + return !t.IsGreaterThan(tag) } // Equals tests Tag equality @@ -106,11 +102,7 @@ func (t Tag) Equals(tag Tag) bool { p1, _ := strconv.Atoi(t.Patch) p2, _ := strconv.Atoi(tag.Patch) - if p1 != p2 { - return false - } - - return true + return p1 == p2 } // String formats a Tag correctly in string representation