summaryrefslogtreecommitdiff
path: root/tools/qmleasing/splineeditor.cpp
diff options
context:
space:
mode:
authorAnton Kudryavtsev <a.kudryavtsev@netris.ru>2016-06-08 15:12:08 +0300
committerAnton Kudryavtsev <a.kudryavtsev@netris.ru>2016-08-12 12:09:35 +0000
commit829c8faee2bd3eed6b62325290f16738e2b5cf5e (patch)
tree5dd94fd2fa86c0db50e60091a9df6bc50a0bb839 /tools/qmleasing/splineeditor.cpp
parent4a7e03fc700cb7431df20a31bed6834a31e6833e (diff)
downloadqtdeclarative-829c8faee2bd3eed6b62325290f16738e2b5cf5e.tar.gz
tools: use QStringRef more
Change-Id: I4fccbfb2b965daf3a31846d1d51d39eb74ad944d Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'tools/qmleasing/splineeditor.cpp')
-rw-r--r--tools/qmleasing/splineeditor.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/tools/qmleasing/splineeditor.cpp b/tools/qmleasing/splineeditor.cpp
index ab22d579f8..ee55931a46 100644
--- a/tools/qmleasing/splineeditor.cpp
+++ b/tools/qmleasing/splineeditor.cpp
@@ -673,14 +673,12 @@ void SplineEditor::setEasingCurve(const QString &code)
if (m_block)
return;
if (code.startsWith(QLatin1Char('[')) && code.endsWith(QLatin1Char(']'))) {
- QString cleanCode = code;
- cleanCode.remove(0, 1);
- cleanCode.chop(1);
- const QStringList stringList = cleanCode.split(QLatin1Char(','), QString::SkipEmptyParts);
+ const QStringRef cleanCode(&code, 1, code.size() - 2);
+ const auto stringList = cleanCode.split(QLatin1Char(','), QString::SkipEmptyParts);
if (stringList.count() >= 6 && (stringList.count() % 6 == 0)) {
QVector<qreal> realList;
realList.reserve(stringList.count());
- foreach (const QString &string, stringList) {
+ for (const QStringRef &string : stringList) {
bool ok;
realList.append(string.toDouble(&ok));
if (!ok)