From 607df95ef6ca5c5a2632d3befbf604dfcfbed530 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Tue, 18 Aug 2009 11:34:03 +0200 Subject: optimize scan() lastChar needs to be set only when in line mode Reviewed-By: mariusSO --- src/corelib/io/qtextstream.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/corelib/io/qtextstream.cpp b/src/corelib/io/qtextstream.cpp index eafc561..415ba60 100644 --- a/src/corelib/io/qtextstream.cpp +++ b/src/corelib/io/qtextstream.cpp @@ -755,12 +755,11 @@ bool QTextStreamPrivate::scan(const QChar **ptr, int *length, int maxlen, TokenD delimSize = (lastChar == QLatin1Char('\r')) ? 2 : 1; consumeDelimiter = true; } + lastChar = ch; break; default: break; } - - lastChar = ch; } } while (!foundToken && (!maxlen || totalSize < maxlen) -- cgit v0.12