From 04d6b05da960078a7cb704b278ac8386884a5331 Mon Sep 17 00:00:00 2001 From: orbitcowboy Date: Thu, 1 Dec 2016 17:54:45 +0100 Subject: [PATCH] preprocessor: It is more efficient to seek for a single character rather than a string. --- lib/preprocessor.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/preprocessor.cpp b/lib/preprocessor.cpp index e0b9e95b6..f22a82283 100644 --- a/lib/preprocessor.cpp +++ b/lib/preprocessor.cpp @@ -743,9 +743,9 @@ bool Preprocessor::validateCfg(const std::string &cfg, const std::list defines; splitcfg(cfg, defines, std::string()); for (std::list::const_iterator defineIt = defines.begin(); defineIt != defines.end(); ++defineIt) { - if (defineIt->find("=") != std::string::npos) + if (defineIt->find('=') != std::string::npos) continue; - const std::string macroName(defineIt->substr(0, defineIt->find("("))); + const std::string macroName(defineIt->substr(0, defineIt->find('('))); for (std::list::const_iterator usageIt = macroUsageList.begin(); usageIt != macroUsageList.end(); ++usageIt) { const simplecpp::MacroUsage &mu = *usageIt; if (mu.macroName != macroName)