Version helper compare operator fix (#1824)

* Version helper compare operator fix

* Simplyfy compare code
This commit is contained in:
PrzemyslawTusinski
2020-04-01 13:30:21 +02:00
committed by GitHub
parent a6b7ba41ee
commit 90a228619e
3 changed files with 17 additions and 41 deletions

View File

@@ -110,16 +110,15 @@ std::future<std::optional<new_version_download_info>> check_for_new_github_relea
winrt::Windows::Foundation::Uri release_page_uri{ json_body.GetNamedString(L"html_url") };
VersionHelper github_version(winrt::to_string(new_version));
VersionHelper current_version(VERSION_MAJOR, VERSION_MINOR, VERSION_REVISION);
if (current_version > github_version)
if (github_version > current_version)
{
co_return std::nullopt;
co_return new_version_download_info{ std::move(release_page_uri), new_version.c_str() };
}
else
{
co_return new_version_download_info{ std::move(release_page_uri), new_version.c_str() };
co_return std::nullopt;
}
}
catch (...)