Fix wxWidgets debugging macros (#1742)

wxFAIL will always generate an assert error and does not expect a
condition.
This commit is contained in:
Alexander Sulfrian 2023-08-09 17:25:25 +02:00 committed by GitHub
parent e02e8c6f15
commit c1e85db46e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -53,7 +53,7 @@ inline wxColour darkModeColorFor2(wxColour const &color)
if (!gDarkMode) if (!gDarkMode)
return color; return color;
auto iter = gDarkColors.find(color); auto iter = gDarkColors.find(color);
wxFAIL(iter != gDarkColors.end()); wxASSERT(iter != gDarkColors.end());
if (iter != gDarkColors.end()) return iter->second; if (iter != gDarkColors.end()) return iter->second;
return color; return color;
} }
@ -69,7 +69,7 @@ wxColour StateColor::lightModeColorFor(wxColour const &color)
{ {
static std::map<wxColour, wxColour> gLightColors = revert(gDarkColors); static std::map<wxColour, wxColour> gLightColors = revert(gDarkColors);
auto iter = gLightColors.find(color); auto iter = gLightColors.find(color);
wxFAIL(iter != gLightColors.end()); wxASSERT(iter != gLightColors.end());
if (iter != gLightColors.end()) return iter->second; if (iter != gLightColors.end()) return iter->second;
return color; return color;
} }