Better variable names, more linear code

This commit is contained in:
Dmitry-Me 2015-12-03 14:20:46 +03:00
parent f624f6fc25
commit cb84b88cb1
1 changed files with 12 additions and 10 deletions

View File

@ -1812,16 +1812,18 @@ std::string Preprocessor::getcode(const std::string &filedata, const std::string
typedef std::set<std::string>::const_iterator It;
for (It it = _settings.userUndefs.begin(); it != _settings.userUndefs.end(); ++it) {
std::string::size_type pos = line.find_first_not_of(' ',8);
if (pos != std::string::npos) {
std::string::size_type pos2 = line.find(*it,pos);
if ((pos2 != std::string::npos) &&
((line.size() == pos2 + (*it).size()) ||
(line[pos2 + (*it).size()] == ' ') ||
(line[pos2 + (*it).size()] == '('))) {
match = false;
break;
}
const std::string::size_type symbolPos = line.find_first_not_of(' ', 8);
if (symbolPos == std::string::npos)
continue;
const std::string::size_type undefMatchPos = line.find(*it, symbolPos);
if (undefMatchPos == std::string::npos)
continue;
const std::string::size_type behindUndefPos = undefMatchPos + (*it).size();
if ((line.size() == behindUndefPos) ||
(line[behindUndefPos] == ' ') ||
(line[behindUndefPos] == '(')) {
match = false;
break;
}
}