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:
parent
f1530d0be1
commit
b5a3a02d51
@ -4019,10 +4019,9 @@ QString QString::section(const QString &sep, int start, int end, SectionFlags fl
|
|||||||
if (start >= sectionsSize || end < 0 || start > end)
|
if (start >= sectionsSize || end < 0 || start > end)
|
||||||
return QString();
|
return QString();
|
||||||
|
|
||||||
int x = 0;
|
|
||||||
QString ret;
|
QString ret;
|
||||||
int first_i = start, last_i = end;
|
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 §ion = sections.at(i);
|
const QStringRef §ion = sections.at(i);
|
||||||
const bool empty = section.isEmpty();
|
const bool empty = section.isEmpty();
|
||||||
if (x >= start) {
|
if (x >= start) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user