QString::section: scope a variable better

Improves code clarity.

Change-Id: If77eb644b1505c84783c907333526a4f08bb75a9
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
This commit is contained in:
Marc Mutz 2014-08-14 09:07:37 +02:00
parent f1530d0be1
commit b5a3a02d51

View File

@ -4019,10 +4019,9 @@ QString QString::section(const QString &sep, int start, int end, SectionFlags fl
if (start >= sectionsSize || end < 0 || start > end)
return QString();
int x = 0;
QString ret;
int first_i = start, last_i = end;
for (int i = 0; x <= end && i < sectionsSize; ++i) {
for (int x = 0, i = 0; x <= end && i < sectionsSize; ++i) {
const QStringRef &section = sections.at(i);
const bool empty = section.isEmpty();
if (x >= start) {