Combine variable declaration and test in a single line

No real changes, make the code slightly shorter.
This commit is contained in:
Vadim Zeitlin
2020-07-21 17:09:43 +02:00
parent 984e222519
commit af7a6ed2d0

View File

@@ -2621,10 +2621,8 @@ bool wxWindowMac::OSXHandleKeyEvent( wxKeyEvent& event )
wxSize wxWindowMac::GetDPI() const
{
wxNonOwnedWindow* tlw = MacGetTopLevelWindow() ;
double scaleFactor;
if ( tlw )
if ( wxNonOwnedWindow* tlw = MacGetTopLevelWindow() )
scaleFactor = tlw->GetContentScaleFactor();
else
scaleFactor = wxOSXGetMainScreenContentScaleFactor();