From kde-commits Sun Dec 04 15:44:30 2016 From: Christian Ehrlicher Date: Sun, 04 Dec 2016 15:44:30 +0000 To: kde-commits Subject: [clazy] checks/level0: QStringRef also has (since Qt5.1) a trimmed() function. This can be used to a Message-Id: X-MARC-Message: https://marc.info/?l=kde-commits&m=148086628026882 Git commit 012dcb71a8b21d4877acb5b697a744eb230d3b75 by Christian Ehrlicher. Committed on 04/12/2016 at 15:43. Pushed by chehrlic into branch 'master'. QStringRef also has (since Qt5.1) a trimmed() function. This can be used to= avoid useless QString allocations within foo.mid(6).trimmed() -> foo.midRe= f(6).trimmed().toString() REVIEW: 129602 M +1 -1 checks/level0/qstringref.cpp https://commits.kde.org/clazy/012dcb71a8b21d4877acb5b697a744eb230d3b75 diff --git a/checks/level0/qstringref.cpp b/checks/level0/qstringref.cpp index 65b1d8f..253f949 100644 --- a/checks/level0/qstringref.cpp +++ b/checks/level0/qstringref.cpp @@ -59,7 +59,7 @@ static bool isInterestingSecondMethod(CXXMethodDecl *meth= od, const clang::LangOp = static const vector list =3D { "compare", "contains", "count",= "startsWith", "endsWith", "indexOf", "isEmpty", "isNull", "lastIndexOf= ", "length", "size", "toDouble", "toFloat", - "toInt", "toUInt", "toULong", "to= ULongLong", "toUShort", "toUcs4"}; + "toInt", "toUInt", "toULong", "to= ULongLong", "toUShort", "toUcs4", "trimmed" }; = if (!clazy_std::contains(list, method->getNameAsString())) return false;