[CPP][Analyzers]Turn on warning 4127 (#21516)

Fix an occurrence on a if changing it to if constexpr
This commit is contained in:
sosssego
2022-11-11 11:01:12 +00:00
committed by GitHub
parent 02f9e3b22e
commit a8d2aeedf2
3 changed files with 4 additions and 4 deletions

View File

@@ -13,7 +13,7 @@ namespace // Strings in this namespace should not be localized
{
const wchar_t LATEST_RELEASE_ENDPOINT[] = L"https://api.github.com/repos/microsoft/PowerToys/releases/latest";
const wchar_t ALL_RELEASES_ENDPOINT[] = L"https://api.github.com/repos/microsoft/PowerToys/releases";
const wchar_t LOCAL_BUILD_ERROR[] = L"Local build cannot be updated";
const wchar_t NETWORK_ERROR[] = L"Network error";
@@ -70,7 +70,7 @@ namespace updating
std::future<nonstd::expected<github_version_info, std::wstring>> get_github_version_info_async(const bool prerelease)
{
// If the current version starts with 0.0.*, it means we're on a local build from a farm and shouldn't check for updates.
if (VERSION_MAJOR == 0 && VERSION_MINOR == 0)
if constexpr (VERSION_MAJOR == 0 && VERSION_MINOR == 0)
{
co_return nonstd::make_unexpected(LOCAL_BUILD_ERROR);
}