From d04c8569ca64446170a8e158a73beb18d1d813f6 Mon Sep 17 00:00:00 2001 From: Artur Wieczorek Date: Sat, 3 Jan 2015 15:10:02 +0000 Subject: [PATCH] Optimize wxPGChoices::Set method. 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 --- include/wx/propgrid/property.h | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/include/wx/propgrid/property.h b/include/wx/propgrid/property.h index 948bc33677..81b0e60ce8 100644 --- a/include/wx/propgrid/property.h +++ b/include/wx/propgrid/property.h @@ -1050,10 +1050,7 @@ public: const wxArrayInt& values = wxArrayInt() ) { Free(); - if ( &values ) - Add(labels,values); - else - Add(labels); + Add(labels,values); } // Creates exclusive copy of current choices