mirror of
https://github.com/geode-sdk/geode.git
synced 2024-11-27 01:45:35 -05:00
make >= default prevent issues
This commit is contained in:
parent
1f7d50a9b9
commit
41aef57758
2 changed files with 12 additions and 8 deletions
|
@ -121,12 +121,15 @@ namespace geode {
|
|||
if (m_version.getMajor() != version.getMajor()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
switch (m_compare) {
|
||||
case VersionCompare::Exact: return m_version == version; break;
|
||||
case VersionCompare::LessEq: return m_version <= version; break;
|
||||
case VersionCompare::MoreEq: return m_version >= version; break;
|
||||
case VersionCompare::LessEq:
|
||||
return m_version <= version;
|
||||
case VersionCompare::MoreEq:
|
||||
return m_version >= version;
|
||||
default:
|
||||
return m_version == version;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
std::string toString() const;
|
||||
|
|
|
@ -115,15 +115,16 @@ Result<ComparableVersionInfo> ComparableVersionInfo::parse(std::string const& ra
|
|||
if (string.starts_with("<=")) {
|
||||
compare = VersionCompare::LessEq;
|
||||
string.erase(0, 2);
|
||||
}
|
||||
else if (string.starts_with(">=")) {
|
||||
} else if (string.starts_with(">=")) {
|
||||
compare = VersionCompare::MoreEq;
|
||||
string.erase(0, 2);
|
||||
}
|
||||
else if (string.starts_with("=")) {
|
||||
} else if (string.starts_with("=")) {
|
||||
compare = VersionCompare::Exact;
|
||||
string.erase(0, 1);
|
||||
} else {
|
||||
compare = VersionCompare::MoreEq;
|
||||
}
|
||||
|
||||
GEODE_UNWRAP_INTO(auto version, VersionInfo::parse(string));
|
||||
return Ok(ComparableVersionInfo(version, compare));
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue