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 wxSize wxWindowMac::GetDPI() const
{ {
wxNonOwnedWindow* tlw = MacGetTopLevelWindow() ;
double scaleFactor; double scaleFactor;
if ( tlw ) if ( wxNonOwnedWindow* tlw = MacGetTopLevelWindow() )
scaleFactor = tlw->GetContentScaleFactor(); scaleFactor = tlw->GetContentScaleFactor();
else else
scaleFactor = wxOSXGetMainScreenContentScaleFactor(); scaleFactor = wxOSXGetMainScreenContentScaleFactor();