Explorar o código

bootmanager: Prevent unnecessary copies in TouchUpdateEvent()

The list of points is returned by const reference, so we don't need to
make a copy of every element in the list.
Lioncash %!s(int64=5) %!d(string=hai) anos
pai
achega
1aba91e993
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      src/yuzu/bootmanager.cpp

+ 1 - 1
src/yuzu/bootmanager.cpp

@@ -452,7 +452,7 @@ void GRenderWindow::TouchUpdateEvent(const QTouchEvent* event) {
     int active_points = 0;
 
     // average all active touch points
-    for (const auto tp : event->touchPoints()) {
+    for (const auto& tp : event->touchPoints()) {
         if (tp.state() & (Qt::TouchPointPressed | Qt::TouchPointMoved | Qt::TouchPointStationary)) {
             active_points++;
             pos += tp.pos();