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:
parent
c327fb79e1
commit
0b3e45fa0a
@ -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);
|
||||
}
|
||||
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user