summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@nokia.com>2009-08-18 09:34:03 (GMT)
committerOswald Buddenhagen <oswald.buddenhagen@nokia.com>2009-09-30 15:33:39 (GMT)
commit607df95ef6ca5c5a2632d3befbf604dfcfbed530 (patch)
tree61c14e2aadb4a9476ff43db3313970b1f08c89b9
parent71de0671ba5e57c7eb34a09d24e08c8926630e0f (diff)
downloadQt-607df95ef6ca5c5a2632d3befbf604dfcfbed530.zip
Qt-607df95ef6ca5c5a2632d3befbf604dfcfbed530.tar.gz
Qt-607df95ef6ca5c5a2632d3befbf604dfcfbed530.tar.bz2
optimize scan()
lastChar needs to be set only when in line mode Reviewed-By: mariusSO
-rw-r--r--src/corelib/io/qtextstream.cpp3
1 files changed, 1 insertions, 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)