From 201089a8a170e8577a266034f7985643d4cafea2 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 6 Mar 2023 17:55:40 +0000 Subject: [PATCH] Slightly simplify wxEntryStart() app creation code No real changes, just combine the variable declaration and test in a single statement. --- src/common/init.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/common/init.cpp b/src/common/init.cpp index 2705a5dea7..c55b23467e 100644 --- a/src/common/init.cpp +++ b/src/common/init.cpp @@ -296,13 +296,10 @@ bool wxEntryStart(int& argc, wxChar **argv) wxAppPtr app(wxTheApp); if ( !app.get() ) { - // if not, he might have used wxIMPLEMENT_APP() to give us a - // function to create it - wxAppInitializerFunction fnCreate = wxApp::GetInitializerFunction(); - - if ( fnCreate ) + // if they didn't, we should normally have the initializer function set + // up by wxIMPLEMENT_APP(), so use it to create one now + if ( auto fnCreate = wxApp::GetInitializerFunction() ) { - // he did, try to create the custom wxApp object app.Set((*fnCreate)()); } }