Refactor lib/checkunusedvar.cpp
This commit is contained in:
parent
d2160f00b2
commit
034296039c
|
@ -230,9 +230,7 @@ void Variables::eraseAliases(unsigned int varid)
|
|||
VariableUsage *usage = find(varid);
|
||||
|
||||
if (usage) {
|
||||
std::set<unsigned int>::const_iterator aliases;
|
||||
|
||||
for (aliases = usage->_aliases.begin(); aliases != usage->_aliases.end(); ++aliases)
|
||||
for (std::set<unsigned int>::const_iterator aliases = usage->_aliases.begin(); aliases != usage->_aliases.end(); ++aliases)
|
||||
erase(*aliases);
|
||||
}
|
||||
}
|
||||
|
@ -280,9 +278,7 @@ void Variables::readAliases(unsigned int varid, const Token* tok)
|
|||
VariableUsage *usage = find(varid);
|
||||
|
||||
if (usage) {
|
||||
std::set<unsigned int>::iterator aliases;
|
||||
|
||||
for (aliases = usage->_aliases.begin(); aliases != usage->_aliases.end(); ++aliases) {
|
||||
for (std::set<unsigned int>::iterator aliases = usage->_aliases.begin(); aliases != usage->_aliases.end(); ++aliases) {
|
||||
VariableUsage *aliased = find(*aliases);
|
||||
|
||||
if (aliased) {
|
||||
|
@ -317,9 +313,7 @@ void Variables::writeAliases(unsigned int varid, const Token* tok)
|
|||
VariableUsage *usage = find(varid);
|
||||
|
||||
if (usage) {
|
||||
std::set<unsigned int>::const_iterator aliases;
|
||||
|
||||
for (aliases = usage->_aliases.begin(); aliases != usage->_aliases.end(); ++aliases) {
|
||||
for (std::set<unsigned int>::const_iterator aliases = usage->_aliases.begin(); aliases != usage->_aliases.end(); ++aliases) {
|
||||
VariableUsage *aliased = find(*aliases);
|
||||
|
||||
if (aliased) {
|
||||
|
@ -344,9 +338,7 @@ void Variables::use(unsigned int varid, const Token* tok)
|
|||
usage->use(_varReadInScope);
|
||||
usage->_lastAccess = tok;
|
||||
|
||||
std::set<unsigned int>::const_iterator aliases;
|
||||
|
||||
for (aliases = usage->_aliases.begin(); aliases != usage->_aliases.end(); ++aliases) {
|
||||
for (std::set<unsigned int>::const_iterator aliases = usage->_aliases.begin(); aliases != usage->_aliases.end(); ++aliases) {
|
||||
VariableUsage *aliased = find(*aliases);
|
||||
|
||||
if (aliased) {
|
||||
|
@ -367,9 +359,7 @@ void Variables::modified(unsigned int varid, const Token* tok)
|
|||
usage->_modified = true;
|
||||
usage->_lastAccess = tok;
|
||||
|
||||
std::set<unsigned int>::const_iterator aliases;
|
||||
|
||||
for (aliases = usage->_aliases.begin(); aliases != usage->_aliases.end(); ++aliases) {
|
||||
for (std::set<unsigned int>::const_iterator aliases = usage->_aliases.begin(); aliases != usage->_aliases.end(); ++aliases) {
|
||||
VariableUsage *aliased = find(*aliases);
|
||||
|
||||
if (aliased) {
|
||||
|
|
Loading…
Reference in New Issue