From 488d62522b66877bf4e3d158974b425d229b193e Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Wed, 16 Jan 2019 12:53:30 +0100 Subject: [PATCH] #3967 Use empty() and const ref --- ApplicationCode/Application/Tools/RiaArgumentParser.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ApplicationCode/Application/Tools/RiaArgumentParser.cpp b/ApplicationCode/Application/Tools/RiaArgumentParser.cpp index 9aef21aea5..05955734cf 100644 --- a/ApplicationCode/Application/Tools/RiaArgumentParser.cpp +++ b/ApplicationCode/Application/Tools/RiaArgumentParser.cpp @@ -123,7 +123,7 @@ bool RiaArgumentParser::parseArguments() // If positional parameter functionality is to be supported, the test for existence of positionalParameters must be removed // This is based on a pull request by @andlaus https://github.com/OPM/ResInsight/pull/162 - if (!parseOk || progOpt.hasOption("help") || progOpt.hasOption("?") || progOpt.positionalParameters().size() > 0) + if (!parseOk || progOpt.hasOption("help") || progOpt.hasOption("?") || !progOpt.positionalParameters().empty()) { #if defined(_MSC_VER) && defined(_WIN32) RiaApplication::instance()->showFormattedTextInMessageBox(helpText); @@ -253,7 +253,7 @@ bool RiaArgumentParser::parseArguments() std::vector gridFileNames = RiaApplication::readFileListFromTextFile(cvfqt::Utils::toQString(o.safeValue(optionIdx++))); - if (groupId != -1 && gridFileNames.size() > 0) + if (groupId != -1 && !gridFileNames.empty()) { projectModifier->setReplaceSourceCasesById(groupId, gridFileNames); } @@ -306,13 +306,13 @@ bool RiaArgumentParser::parseArguments() bool snapshotPlots = false; QStringList snapshotItemTexts = cvfqt::Utils::toQStringList(o.values()); - if (snapshotItemTexts.size() == 0) + if (snapshotItemTexts.empty()) { // No options will keep backwards compatibility before we introduced snapshot of plots snapshotViews = true; } - for (QString s : snapshotItemTexts) + for (const QString& s : snapshotItemTexts) { if (s.toLower() == "all") {