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; return;
} }
QString prog = args.first(); const QString prog = args.takeFirst();
args.removeFirst();
start(prog, args, mode); start(prog, args, mode);
} }
@ -2552,8 +2551,7 @@ bool QProcess::startDetached(const QString &command)
if (args.isEmpty()) if (args.isEmpty())
return false; return false;
QString prog = args.first(); const QString prog = args.takeFirst();
args.removeFirst();
return QProcessPrivate::startDetached(prog, args); return QProcessPrivate::startDetached(prog, args);
} }

View File

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