Merge pull request #739 from Dmitry-Me/repeatedSearch
Omit repeated search
This commit is contained in:
commit
d5e9bb4323
|
@ -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 = "";
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue