Skip to content

Commit

Permalink
Optimize wxPGChoices::Set method.
Browse files Browse the repository at this point in the history
There is no need to check if referenced array with values is 
valid since "reference cannot be bound to dereferenced null pointer in well-defined C++ code".
Moreover, conditional call of Add() methods(one with explicit parameter and one with default one) is not necessary.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78343 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
  • Loading branch information
a-wi committed Jan 3, 2015
1 parent febb9c2 commit d04c856
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions include/wx/propgrid/property.h
Original file line number Diff line number Diff line change
Expand Up @@ -1050,10 +1050,7 @@ class WXDLLIMPEXP_PROPGRID wxPGChoices
const wxArrayInt& values = wxArrayInt() )
{
Free();
if ( &values )
Add(labels,values);
else
Add(labels);
Add(labels,values);
}

// Creates exclusive copy of current choices
Expand Down

0 comments on commit d04c856

Please sign in to comment.