Fix warning about unused variable in release build

Refactor the code to remove variable which is used only in the assertion.

See #14213.
This commit is contained in:
Artur Wieczorek
2017-08-20 21:18:00 +02:00
parent 42e9eb7ce8
commit e56cb112d3
2 changed files with 10 additions and 6 deletions

View File

@@ -370,9 +370,11 @@ bool wxMenu::DoInsertOrAppend(wxMenuItem *pItem, size_t pos)
} }
else if ( m_radioData ) else if ( m_radioData )
{ {
bool groupWasSplit = m_radioData->UpdateOnInsertNonRadio(pos); if ( m_radioData->UpdateOnInsertNonRadio(pos) )
wxASSERT_MSG( !groupWasSplit, {
wxS("Inserting non-radio item inside a radio group?") ); // One of the exisiting groups has been split into two subgroups.
wxFAIL_MSG(wxS("Inserting non-radio item inside a radio group?"));
}
} }
// Also handle the case of check menu items that had been checked before // Also handle the case of check menu items that had been checked before

View File

@@ -149,9 +149,11 @@ bool wxMenu::DoInsertOrAppend(wxMenuItem *item, size_t pos)
} }
else if ( m_radioData ) else if ( m_radioData )
{ {
bool groupWasSplit = m_radioData->UpdateOnInsertNonRadio(pos); if ( m_radioData->UpdateOnInsertNonRadio(pos) )
wxASSERT_MSG( !groupWasSplit, {
wxS("Inserting non-radio item inside a radio group?") ); // One of the exisiting groups has been split into two subgroups.
wxFAIL_MSG(wxS("Inserting non-radio item inside a radio group?"));
}
} }
// if we're already attached to the menubar, we must update it // if we're already attached to the menubar, we must update it