Slightly simplify wxEntryStart() app creation code

No real changes, just combine the variable declaration and test in a
single statement.
This commit is contained in:
Vadim Zeitlin 2023-03-06 17:55:40 +00:00
parent 5f486a0806
commit 201089a8a1

View file

@ -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)());
}
}