diff --git a/lib/checkother.cpp b/lib/checkother.cpp index aa14c5a51..6eedf5a35 100644 --- a/lib/checkother.cpp +++ b/lib/checkother.cpp @@ -570,11 +570,11 @@ static void eraseNotLocalArg(std::map& container, co } } -static void eraseMemberAssignments(const unsigned int varId, std::map > &membervars, std::map &varAssignments) +static void eraseMemberAssignments(const unsigned int varId, const std::map > &membervars, std::map &varAssignments) { const std::map >::const_iterator it = membervars.find(varId); if (it != membervars.end()) { - const std::set v = it->second; + const std::set& v = it->second; for (std::set::const_iterator vit = v.begin(); vit != v.end(); ++vit) { varAssignments.erase(*vit); if (*vit != varId)