C++: Simplify Lexer::yyinp()

... by assuming we operate on NUL-terminated data, which is
(in theory) guaranteed by (non-raw) QByteArray which we have.

Change-Id: I855d01ea0dee5328ec737fbabee1086d7a28aa5a
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
This commit is contained in:
hjk
2013-04-15 17:33:52 +02:00
committed by Erik Verbruggen
parent c95d1705aa
commit a1c7c47cc0

View File

@@ -99,13 +99,9 @@ private:
inline void yyinp()
{
if (++_currentChar == _lastChar)
_yychar = 0;
else {
_yychar = *_currentChar;
if (_yychar == '\n')
pushLineStartOffset();
}
_yychar = *++_currentChar;
if (Q_UNLIKELY(_yychar == '\n'))
pushLineStartOffset();
}
void pushLineStartOffset();