浏览代码

Merge pull request #4605 from lioncash/copy3

bootmanager: Prevent unnecessary copies in TouchUpdateEvent()
bunnei 5 年之前
父节点
当前提交
37faf24c3f
共有 1 个文件被更改,包括 1 次插入1 次删除
  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;
     int active_points = 0;
 
 
     // average all active touch points
     // 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)) {
         if (tp.state() & (Qt::TouchPointPressed | Qt::TouchPointMoved | Qt::TouchPointStationary)) {
             active_points++;
             active_points++;
             pos += tp.pos();
             pos += tp.pos();