MCPcopy Create free account
hub / github.com/cppcheck-opensource/cppcheck / clearConst

Method clearConst

lib/checkunusedvar.cpp:146–154  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

144 mVarUsage.clear();
145 }
146 void clearConst() {
147 std::set<int> keys;
148 for (const std::pair<const nonneg int, Variables::VariableUsage>& var : mVarUsage) {
149 if (var.second._var && var.second._var->isConst())
150 keys.emplace(var.first);
151 }
152 for (const int key : keys)
153 mVarUsage.erase(key);
154 }
155 const std::map<nonneg int, VariableUsage> &varUsage() const {
156 return mVarUsage;
157 }

Calls 2

isConstMethod · 0.80
eraseMethod · 0.45

Tested by

no test coverage detected