diff options
| author | 2020-08-29 13:51:47 -0400 | |
|---|---|---|
| committer | 2020-08-29 14:33:10 -0400 | |
| commit | 1aba91e993d933c30c4201a3ada3ea6dea96eebb (patch) | |
| tree | d0a946e416a245e32bd89307ed23dc515468a85e | |
| parent | Merge pull request #4600 from lioncash/prototype (diff) | |
| download | yuzu-1aba91e993d933c30c4201a3ada3ea6dea96eebb.tar.gz yuzu-1aba91e993d933c30c4201a3ada3ea6dea96eebb.tar.xz yuzu-1aba91e993d933c30c4201a3ada3ea6dea96eebb.zip | |
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.
| -rw-r--r-- | src/yuzu/bootmanager.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/yuzu/bootmanager.cpp b/src/yuzu/bootmanager.cpp index f1b428bde..a6d51c291 100644 --- a/src/yuzu/bootmanager.cpp +++ b/src/yuzu/bootmanager.cpp | |||
| @@ -452,7 +452,7 @@ void GRenderWindow::TouchUpdateEvent(const QTouchEvent* event) { | |||
| 452 | int active_points = 0; | 452 | int active_points = 0; |
| 453 | 453 | ||
| 454 | // average all active touch points | 454 | // average all active touch points |
| 455 | for (const auto tp : event->touchPoints()) { | 455 | for (const auto& tp : event->touchPoints()) { |
| 456 | if (tp.state() & (Qt::TouchPointPressed | Qt::TouchPointMoved | Qt::TouchPointStationary)) { | 456 | if (tp.state() & (Qt::TouchPointPressed | Qt::TouchPointMoved | Qt::TouchPointStationary)) { |
| 457 | active_points++; | 457 | active_points++; |
| 458 | pos += tp.pos(); | 458 | pos += tp.pos(); |