Use takeFirst() instead of first() with removeFirst()

Reduce code size and improve readability.

Change-Id: I5ec035a39cb607f15748aaa08d73f1c1bc8e4ad8
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
Anton Kudryavtsev 2016-04-11 15:33:41 +03:00
parent c327fb79e1
commit 0b3e45fa0a
2 changed files with 3 additions and 6 deletions

View File

@ -2309,8 +2309,7 @@ void QProcess::start(const QString &command, OpenMode mode)
return;
}
QString prog = args.first();
args.removeFirst();
const QString prog = args.takeFirst();
start(prog, args, mode);
}
@ -2552,8 +2551,7 @@ bool QProcess::startDetached(const QString &command)
if (args.isEmpty())
return false;
QString prog = args.first();
args.removeFirst();
const QString prog = args.takeFirst();
return QProcessPrivate::startDetached(prog, args);
}

View File

@ -3377,8 +3377,7 @@ void QHeaderViewPrivate::resizeSections(QHeaderView::ResizeMode globalMode, bool
}
section_sizes.removeFirst();
} else {
newSectionLength = section_sizes.front();
section_sizes.removeFirst();
newSectionLength = section_sizes.takeFirst();
}
}