diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2019-06-13 12:55:17 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2019-07-29 20:43:26 +0200 |
commit | 111df3b5e04ffc6467be08bb84990aba48bf6b5a (patch) | |
tree | 2a425b325d752b488ed671ac2881c0a1d05fce04 /src/testlib/qbenchmarkvalgrind.cpp | |
parent | afb8ba3fd22ca86ec3438a04c08353c9ddcaca1a (diff) | |
download | qtbase-111df3b5e04ffc6467be08bb84990aba48bf6b5a.tar.gz |
QTestLib: Fix various clang warnings
- Fix else after return/break
- Fix use of int as boolean literal
- Use range-based for in some cases
- Avoid copies by using const-ref
- Remove unnecessary null-check before delete
Task-number: QTBUG-69413
Change-Id: I69f46e6deaa55ef70a8b3a61e6539c79a64aaa23
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Diffstat (limited to 'src/testlib/qbenchmarkvalgrind.cpp')
-rw-r--r-- | src/testlib/qbenchmarkvalgrind.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/testlib/qbenchmarkvalgrind.cpp b/src/testlib/qbenchmarkvalgrind.cpp index 0dac804338..44888c4d30 100644 --- a/src/testlib/qbenchmarkvalgrind.cpp +++ b/src/testlib/qbenchmarkvalgrind.cpp @@ -168,7 +168,7 @@ QString QBenchmarkValgrindUtils::outFileBase(qint64 pid) // Returns \c true upon success, otherwise false. bool QBenchmarkValgrindUtils::runCallgrindSubProcess(const QStringList &origAppArgs, int &exitCode) { - const QString execFile(origAppArgs.at(0)); + const QString &execFile = origAppArgs.at(0); QStringList args; args << QLatin1String("--tool=callgrind") << QLatin1String("--instr-atstart=yes") << QLatin1String("--quiet") @@ -177,7 +177,7 @@ bool QBenchmarkValgrindUtils::runCallgrindSubProcess(const QStringList &origAppA // pass on original arguments that make sense (e.g. avoid wasting time producing output // that will be ignored anyway) ... for (int i = 1; i < origAppArgs.size(); ++i) { - const QString arg(origAppArgs.at(i)); + const QString &arg = origAppArgs.at(i); if (arg == QLatin1String("-callgrind")) continue; args << arg; // ok to pass on |