Avoid unnecessary wxDynamicCast in wxOSX code
There is no need to check if the control is a wxComboBox if it turns out to already be a wxTextCtrl. No real changes, just a micro-optimization and simplification.
This commit is contained in:
@@ -2440,14 +2440,12 @@ void wxWidgetCocoaImpl::controlTextDidChange()
|
||||
if ( wxpeer )
|
||||
{
|
||||
// since native rtti doesn't have to be enabled and wx' rtti is not aware of the mixin wxTextEntry, workaround is needed
|
||||
wxTextCtrl *tc = wxDynamicCast( wxpeer , wxTextCtrl );
|
||||
wxComboBox *cb = wxDynamicCast( wxpeer , wxComboBox );
|
||||
if ( tc )
|
||||
if ( wxTextCtrl *tc = wxDynamicCast( wxpeer , wxTextCtrl ) )
|
||||
{
|
||||
tc->MarkDirty();
|
||||
tc->SendTextUpdatedEventIfAllowed();
|
||||
}
|
||||
else if ( cb )
|
||||
else if ( wxComboBox *cb = wxDynamicCast( wxpeer , wxComboBox ) )
|
||||
cb->SendTextUpdatedEventIfAllowed();
|
||||
else
|
||||
{
|
||||
|
Reference in New Issue
Block a user