preprocessor: It is more efficient to seek for a single character rather than a string.

This commit is contained in:
orbitcowboy 2016-12-01 17:54:45 +01:00
parent 4a439b9308
commit 04d6b05da9
1 changed files with 2 additions and 2 deletions

View File

@ -743,9 +743,9 @@ bool Preprocessor::validateCfg(const std::string &cfg, const std::list<simplecpp
std::list<std::string> defines;
splitcfg(cfg, defines, std::string());
for (std::list<std::string>::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<simplecpp::MacroUsage>::const_iterator usageIt = macroUsageList.begin(); usageIt != macroUsageList.end(); ++usageIt) {
const simplecpp::MacroUsage &mu = *usageIt;
if (mu.macroName != macroName)