diff --git a/src/libs/3rdparty/cplusplus/Lexer.h b/src/libs/3rdparty/cplusplus/Lexer.h
index 0d527f1d828aaed9800b2ea31d7cd4cb72ffe584..e2e39ed4807da1a758c0dce3f9c02df2110ecd86 100644
--- a/src/libs/3rdparty/cplusplus/Lexer.h
+++ b/src/libs/3rdparty/cplusplus/Lexer.h
@@ -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();