replaceArgEscapes(): correct a comment and assert what it relies on

Change-Id: I1d0c82b1cac0d59bd1fbda65f6a3e5be346b4c70
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
Edward Welbourne 2021-08-02 17:46:49 +02:00
parent 2452a7e184
commit 54abc61af1

View File

@ -7783,9 +7783,10 @@ static QString replaceArgEscapes(QStringView s, const ArgEscapeData &d, qsizetyp
const QChar *c = s.begin();
const QChar *const uc_end = s.end();
while (c != uc_end) {
/* We don't have to check if we run off the end of the string with c,
because as long as d.occurrences > 0 we KNOW there are valid escape
sequences. */
Q_ASSERT(d.occurrences > repl_cnt);
/* We don't have to check increments of c against uc_end because, as
long as d.occurrences > repl_cnt, we KNOW there are valid escape
sequences remaining. */
const QChar *text_start = c;