QTextStream: fix a dead write

Found by Clazy.

Change-Id: Iabe4fb23f63ea8df2142dc66cd16b04526b628c2
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
This commit is contained in:
Marc Mutz 2021-06-16 10:29:01 +02:00
parent 95cb4e2260
commit 259dc8cbe5

View File

@ -560,7 +560,6 @@ bool QTextStreamPrivate::scan(const QChar **ptr, int *length, int maxlen, TokenD
int startOffset = device ? readBufferOffset : stringOffset; int startOffset = device ? readBufferOffset : stringOffset;
QChar lastChar; QChar lastChar;
bool canStillReadFromDevice = true;
do { do {
int endOffset; int endOffset;
const QChar *chPtr; const QChar *chPtr;
@ -602,7 +601,7 @@ bool QTextStreamPrivate::scan(const QChar **ptr, int *length, int maxlen, TokenD
} }
} while (!foundToken } while (!foundToken
&& (!maxlen || totalSize < maxlen) && (!maxlen || totalSize < maxlen)
&& (device && (canStillReadFromDevice = fillReadBuffer()))); && device && fillReadBuffer());
if (totalSize == 0) { if (totalSize == 0) {
#if defined (QTEXTSTREAM_DEBUG) #if defined (QTEXTSTREAM_DEBUG)