Commit a8425817 authored by Elvis Angelaccio's avatar Elvis Angelaccio

cppcheck: simplify if guard

if pos > 1, then pos != -1 is always going to be true.
parent 71fac0c2
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment