Fix recursive comparison in VersionTag

This commit is contained in:
alk 2023-03-07 11:56:36 +03:00 committed by GitHub
parent 530be4cfbb
commit 1b2c7606b6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -78,28 +78,28 @@ namespace geode {
};
constexpr bool operator<(std::optional<VersionTag> const& a, std::optional<VersionTag> const& b) {
if (a && b) return a < b;
if (a && b) return *a < *b;
if (a) return true;
if (b) return false;
return false;
}
constexpr bool operator<=(std::optional<VersionTag> const& a, std::optional<VersionTag> const& b) {
if (a && b) return a <= b;
if (a && b) return *a <= *b;
if (a) return true;
if (b) return false;
return true;
}
constexpr bool operator>(std::optional<VersionTag> const& a, std::optional<VersionTag> const& b) {
if (a && b) return a > b;
if (a && b) return *a > *b;
if (a) return false;
if (b) return true;
return false;
}
constexpr bool operator>=(std::optional<VersionTag> const& a, std::optional<VersionTag> const& b) {
if (a && b) return a >= b;
if (a && b) return *a >= *b;
if (a) return false;
if (b) return true;
return true;
@ -230,4 +230,4 @@ struct json::Serialize<V> {
}
return ver.unwrap();
}
};
};