From 95d6b2239a3396b1fce3ad2f4dea370b39bad660 Mon Sep 17 00:00:00 2001 From: Username404 Date: Tue, 14 Sep 2021 20:22:42 +0200 Subject: [PATCH] Append characters directly instead of creating a new string in the default case of lexer.cpp --- src/etc/lexer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/etc/lexer.cpp b/src/etc/lexer.cpp index 25f6ab3..5ff64a7 100644 --- a/src/etc/lexer.cpp +++ b/src/etc/lexer.cpp @@ -36,7 +36,7 @@ vector lex(const string& in) const bool isString = currentCharType == STRING; if (isTypeString && (i == in.size() - 1 && not isString)) throw tok::LexerException("A never ending string was found", lineNumber); if ((currentCharType == type || isTypeString) && !isString) { - formedString += string(1, in[i]); + formedString += in[i]; } else { if (not isTypeString) --i; resVal.emplace_back(type, formedString, lineNumber);