From 6989670e8f5487f023795910ffa4001d8d23b6e5 Mon Sep 17 00:00:00 2001 From: Reijo Tomperi Date: Fri, 2 Oct 2009 15:38:41 +0300 Subject: [PATCH] Abort comma simplification when ", %num%" is detected. This increases speed a lot in some rare situations. --- src/tokenize.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/tokenize.cpp b/src/tokenize.cpp index 5a82af5d6..044c36e0c 100644 --- a/src/tokenize.cpp +++ b/src/tokenize.cpp @@ -4031,7 +4031,8 @@ void Tokenizer::simplifyComma() } } - if (tok->str() != ",") + // If token after the comma is a constant number, simplification is not required. + if (tok->str() != "," || Token::Match(tok->next(), "%num%")) continue; // We must not accept just any keyword, e.g. accepting int