Don't make unnecessary calls to the member function

Use already obtained reference to the list of selected properties instead of retrieving the list by calling GetSelectedProperties() function.
This commit is contained in:
Artur Wieczorek
2018-12-26 10:02:10 +01:00
parent 6c36554ae1
commit d85a03b561

View File

@@ -841,7 +841,7 @@ bool wxPropertyGrid::AddToSelectionFromInputEvent( wxPGProperty* prop,
{
// Allow right-click for context menu without
// disturbing the selection.
if ( GetSelectedProperties().size() <= 1 ||
if ( selection.size() <= 1 ||
!alreadySelected )
return DoSelectAndEdit(prop, colIndex, selFlags);
return true;
@@ -870,7 +870,7 @@ bool wxPropertyGrid::AddToSelectionFromInputEvent( wxPGProperty* prop,
{
res = DoAddToSelection(prop, selFlags);
}
else if ( GetSelectedProperties().size() > 1 )
else if ( selection.size() > 1 )
{
res = DoRemoveFromSelection(prop, selFlags);
}