mirror of
https://github.com/loot/libloot.git
synced 2026-07-27 14:16:01 -07:00
Re-implement Version comparison operators.
In terms of the less-than operator, for more consistent behaviour.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user