Add brackets to optimize statement

Not having brackets forces the compiler to see the statement as (xdelta
* 360.0) * 8.0, which requires two `mulsd` operations. Adding the
brackets only requires one.

More details here
https://github.com/OpenVR-Advanced-Settings/OpenVR-AdvancedSettings/pull/87
This commit is contained in:
Vasily
2019-02-21 18:48:53 +01:00
committed by username223
parent 90ad7e7270
commit 4814c4686f
+4 -4
View File
@@ -644,10 +644,10 @@ void OverlayController::mainEventLoop()
m_ptLastMouse,
m_pWindow->mapToGlobal( m_ptLastMouse ),
QPoint(),
QPoint( static_cast<int>( vrEvent.data.scroll.xdelta * 360.0f
* 8.0f ),
static_cast<int>( vrEvent.data.scroll.ydelta * 360.0f
* 8.0f ) ),
QPoint( static_cast<int>( vrEvent.data.scroll.xdelta
* ( 360.0f * 8.0f ) ),
static_cast<int>( vrEvent.data.scroll.ydelta
* ( 360.0f * 8.0f ) ) ),
0,
Qt::Vertical,
m_lastMouseButtons,