aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/qmldesigner/components/timelineeditor
diff options
context:
space:
mode:
authorAlessandro Portale <alessandro.portale@qt.io>2020-06-13 23:04:31 +0200
committerAlessandro Portale <alessandro.portale@qt.io>2020-06-14 20:10:01 +0000
commit625a35e492f4da458044368c5df6a21fdd2c9417 (patch)
treeefdd27c6aeecc7fbfdfcd0a1f92f0489179fe9e0 /src/plugins/qmldesigner/components/timelineeditor
parente2670bf3e62d9a4a1aea5029b600fc292dfd1e5b (diff)
QmlDesigner: performance-for-range-copy
Avoid copying the loop variable on each iteration if a const reference would suffice. For QPointers<>, this change only adds a const. Change-Id: I5abe7d793cd46859a9a4f9304ec1bd41f899d72c Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Diffstat (limited to 'src/plugins/qmldesigner/components/timelineeditor')
-rw-r--r--src/plugins/qmldesigner/components/timelineeditor/timelineactions.cpp2
-rw-r--r--src/plugins/qmldesigner/components/timelineeditor/timelinesectionitem.cpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/plugins/qmldesigner/components/timelineeditor/timelineactions.cpp b/src/plugins/qmldesigner/components/timelineeditor/timelineactions.cpp
index 4d2523b3a3..c9271e490c 100644
--- a/src/plugins/qmldesigner/components/timelineeditor/timelineactions.cpp
+++ b/src/plugins/qmldesigner/components/timelineeditor/timelineactions.cpp
@@ -252,7 +252,7 @@ std::vector<std::tuple<ModelNode, qreal>> getFramesRelative(const ModelNode &par
if (!sortedByTime.empty()) {
qreal firstTime = getTime(sortedByTime.first());
- for (ModelNode keyframe : sortedByTime)
+ for (const ModelNode &keyframe : sortedByTime)
result.emplace_back(keyframe, getTime(keyframe) - firstTime);
}
diff --git a/src/plugins/qmldesigner/components/timelineeditor/timelinesectionitem.cpp b/src/plugins/qmldesigner/components/timelineeditor/timelinesectionitem.cpp
index d8d34fe1d1..7e8bfb6f50 100644
--- a/src/plugins/qmldesigner/components/timelineeditor/timelinesectionitem.cpp
+++ b/src/plugins/qmldesigner/components/timelineeditor/timelinesectionitem.cpp
@@ -209,7 +209,7 @@ ModelNode TimelineSectionItem::targetNode() const
QVector<qreal> TimelineSectionItem::keyframePositions() const
{
QVector<qreal> out;
- for (auto frame : m_timeline.keyframeGroupsForTarget(m_targetNode))
+ for (const auto &frame : m_timeline.keyframeGroupsForTarget(m_targetNode))
out.append(timelineScene()->keyframePositions(frame));
return out;