Merge pull request #739 from Dmitry-Me/repeatedSearch

Omit repeated search
This commit is contained in:
PKEuS 2015-12-23 16:24:50 +01:00
commit d5e9bb4323
1 changed files with 3 additions and 2 deletions

View File

@ -2763,8 +2763,9 @@ public:
const std::map<std::string, PreprocessorMacro *>::const_iterator it = macros.find(str); const std::map<std::string, PreprocessorMacro *>::const_iterator it = macros.find(str);
if (it != macros.end() && it->second->_macro.find('(') == std::string::npos) { if (it != macros.end() && it->second->_macro.find('(') == std::string::npos) {
str = it->second->_macro; str = it->second->_macro;
if (str.find(' ') != std::string::npos) const std::string::size_type whitespacePos = str.find(' ');
str.erase(0, str.find(' ')); if (whitespacePos != std::string::npos)
str.erase(0, whitespacePos);
else else
str = ""; str = "";
} }