diff options
Diffstat (limited to 'tools/qmleasing/splineeditor.cpp')
-rw-r--r-- | tools/qmleasing/splineeditor.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/tools/qmleasing/splineeditor.cpp b/tools/qmleasing/splineeditor.cpp index a2ddc056df..b957cab4fe 100644 --- a/tools/qmleasing/splineeditor.cpp +++ b/tools/qmleasing/splineeditor.cpp @@ -680,6 +680,7 @@ void SplineEditor::setEasingCurve(const QString &code) const QStringList stringList = cleanCode.split(QLatin1Char(','), QString::SkipEmptyParts); if (stringList.count() >= 6 && (stringList.count() % 6 == 0)) { QList<qreal> realList; + realList.reserve(stringList.count()); foreach (const QString &string, stringList) { bool ok; realList.append(string.toDouble(&ok)); @@ -687,7 +688,9 @@ void SplineEditor::setEasingCurve(const QString &code) return; } QList<QPointF> points; - for (int i = 0; i < realList.count() / 2; ++i) + const int count = realList.count() / 2; + points.reserve(count); + for (int i = 0; i < count; ++i) points.append(QPointF(realList.at(i * 2), realList.at(i * 2 + 1))); if (points.last() == QPointF(1.0, 1.0)) { QEasingCurve easingCurve(QEasingCurve::BezierSpline); |