Skip to content
Snippets Groups Projects
Commit a1c7c47c authored by hjk's avatar hjk Committed by Erik Verbruggen
Browse files

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: default avatarErik Verbruggen <erik.verbruggen@digia.com>
parent c95d1705
No related branches found
No related tags found
No related merge requests found
......@@ -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();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment