summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorElvis Angelaccio <[email protected]>2016-05-06 16:57:05 +0200
committerElvis Angelaccio <[email protected]>2016-05-06 16:57:05 +0200
commita84258170dd96b9e7c36e7633b106db0159a283d (patch)
tree72be7aea2566ed724af2b72d1c627d60cbd0e937
parent71fac0c2691aae5d2aa0f3f5ee5e13a488892c00 (diff)
cppcheck: simplify if guard
if pos > 1, then pos != -1 is always going to be true.
-rw-r--r--kerfuffle/cliinterface.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/kerfuffle/cliinterface.cpp b/kerfuffle/cliinterface.cpp
index d2d391e..c8f86cf 100644
--- a/kerfuffle/cliinterface.cpp
+++ b/kerfuffle/cliinterface.cpp
@@ -975,7 +975,7 @@ void CliInterface::handleLine(const QString& line)
if ((m_operationMode == Copy || m_operationMode == Add) && m_param.contains(CaptureProgress) && m_param.value(CaptureProgress).toBool()) {
//read the percentage
int pos = line.indexOf(QLatin1Char( '%' ));
- if (pos != -1 && pos > 1) {
+ if (pos > 1) {
int percentage = line.midRef(pos - 2, 2).toInt();
emit progress(float(percentage) / 100);
return;