From 334a8c70ecee708203c6ff93dd51a617c7ecf9cc Mon Sep 17 00:00:00 2001 From: Artur Wieczorek Date: Fri, 27 May 2022 18:52:37 +0200 Subject: [PATCH] Use conditional operators to simplify statements --- src/propgrid/property.cpp | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/src/propgrid/property.cpp b/src/propgrid/property.cpp index 394c9c7d06..e7112ad46b 100644 --- a/src/propgrid/property.cpp +++ b/src/propgrid/property.cpp @@ -1115,12 +1115,7 @@ bool wxPGProperty::StringToValue( wxVariant& v, const wxString& text, int argFla wxS(">> %s.StringToValue('%s')"), GetLabel(), text); wxString::const_iterator it = text.begin(); - wxUniChar a; - - if ( it != text.end() ) - a = *it; - else - a = 0; + wxUniChar a = ( it != text.end() ) ? *it : 0; for ( ;; ) { @@ -1274,14 +1269,7 @@ bool wxPGProperty::StringToValue( wxVariant& v, const wxString& text, int argFla it += strPosIncrement; - if ( it != text.end() ) - { - a = *it; - } - else - { - a = 0; - } + a = ( it != text.end() ) ? *it : 0; pos += strPosIncrement; }