Declare variable only needed inside an "if" inside it

No real changes, just make the code slightly more concise.
This commit is contained in:
Vadim Zeitlin
2019-01-23 16:47:05 +01:00
parent 6b3a0cc460
commit 9c16a3748e

View File

@@ -156,8 +156,7 @@ public:
private:
void valueChanged(int value)
{
wxControl *handler = GetHandler();
if ( handler )
if ( wxControl *handler = GetHandler() )
{
wxSpinEvent event( wxEVT_SPINCTRL, handler->GetId() );
event.SetInt( value );
@@ -178,8 +177,7 @@ public:
private:
void valueChanged(double value)
{
wxControl *handler = GetHandler();
if ( handler )
if ( wxControl *handler = GetHandler() )
{
wxSpinDoubleEvent event( wxEVT_SPINCTRLDOUBLE, handler->GetId() );
event.SetValue(value);