From 80aab0efaf4146d82df4c5e5dcdaf7eb2a844a25 Mon Sep 17 00:00:00 2001 From: Oliver Hamlet Date: Sun, 19 Jul 2015 00:51:12 +0100 Subject: [PATCH] Re-implement Version comparison operators. In terms of the less-than operator, for more consistent behaviour. --- src/backend/helpers/version.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/backend/helpers/version.cpp b/src/backend/helpers/version.cpp index bb022f4e..29ac2ce1 100644 --- a/src/backend/helpers/version.cpp +++ b/src/backend/helpers/version.cpp @@ -138,22 +138,22 @@ namespace loot { } bool Version::operator > (const Version& ver) const { - return (*this != ver && !(*this < ver)); + return ver < *this; } bool Version::operator >= (const Version& ver) const { - return (*this == ver || *this > ver); + return ver < *this || !(*this < ver); } bool Version::operator <= (const Version& ver) const { - return (*this == ver || *this < ver); + return *this < ver || !(ver < *this); } bool Version::operator == (const Version& ver) const { - return (verString == ver.AsString()); + return !(*this < ver) && !(ver < *this); } bool Version::operator != (const Version& ver) const { - return !(*this == ver); - } + return *this < ver || ver < *this; } +}