replaceArgEscapes(): rename a local variable and simplify initialization

The name coincided with one used in other functions for a different
meaning and its initialization was clumsy. Rename to a terser name
that communicates the relevant matter more clearly.

Change-Id: I6baf8e5ec695cbbb1cc10f6c4b4cc6512c1aefc4
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
bb10
Edward Welbourne 2021-08-02 17:23:36 +02:00
parent 00b7679d7a
commit 70adce61ad
1 changed files with 4 additions and 6 deletions

View File

@ -7795,11 +7795,9 @@ static QString replaceArgEscapes(QStringView s, const ArgEscapeData &d, int fiel
const QChar *escape_start = c++;
bool locale_arg = false;
if (c->unicode() == 'L') {
locale_arg = true;
const bool localize = c->unicode() == 'L';
if (localize)
++c;
}
int escape = c->digitValue();
if (escape != -1) {
@ -7820,7 +7818,7 @@ static QString replaceArgEscapes(QStringView s, const ArgEscapeData &d, int fiel
rc += escape_start - text_start;
uint pad_chars;
if (locale_arg)
if (localize)
pad_chars = qMax(abs_field_width, larg.length()) - larg.length();
else
pad_chars = qMax(abs_field_width, arg.length()) - arg.length();
@ -7830,7 +7828,7 @@ static QString replaceArgEscapes(QStringView s, const ArgEscapeData &d, int fiel
*rc++ = fillChar;
}
if (locale_arg) {
if (localize) {
memcpy(rc, larg.data(), larg.length()*sizeof(QChar));
rc += larg.length();
}