Remove unneded deep copy, make reference const

This commit is contained in:
Dmitry-Me 2015-03-14 13:45:21 +03:00
parent d52e3c8eb7
commit 43a19dee8b
1 changed files with 2 additions and 2 deletions

View File

@ -570,11 +570,11 @@ static void eraseNotLocalArg(std::map<unsigned int, const Token*>& container, co
} }
} }
static void eraseMemberAssignments(const unsigned int varId, std::map<unsigned int, std::set<unsigned int> > &membervars, std::map<unsigned int, const Token*> &varAssignments) static void eraseMemberAssignments(const unsigned int varId, const std::map<unsigned int, std::set<unsigned int> > &membervars, std::map<unsigned int, const Token*> &varAssignments)
{ {
const std::map<unsigned int, std::set<unsigned int> >::const_iterator it = membervars.find(varId); const std::map<unsigned int, std::set<unsigned int> >::const_iterator it = membervars.find(varId);
if (it != membervars.end()) { if (it != membervars.end()) {
const std::set<unsigned int> v = it->second; const std::set<unsigned int>& v = it->second;
for (std::set<unsigned int>::const_iterator vit = v.begin(); vit != v.end(); ++vit) { for (std::set<unsigned int>::const_iterator vit = v.begin(); vit != v.end(); ++vit) {
varAssignments.erase(*vit); varAssignments.erase(*vit);
if (*vit != varId) if (*vit != varId)