Merge pull request #11625 from stiopaa1/mds_damageTable_removeUnneededCount

mds/DamageTable.cc: remove unneeded use of count

Reviewed-by: Greg Farnum <gfarnum@redhat.com>
This commit is contained in:
John Spray 2016-10-28 11:01:34 +01:00 committed by GitHub
commit c88a71a8a8

View File

@ -244,11 +244,12 @@ void DamageTable::dump(Formatter *f) const
void DamageTable::erase(damage_entry_id_t damage_id)
{
if (by_id.count(damage_id) == 0) {
auto by_id_entry = by_id.find(damage_id);
if (by_id_entry == by_id.end()) {
return;
}
DamageEntryRef entry = by_id.at(damage_id);
DamageEntryRef entry = by_id_entry->second;
assert(entry->id == damage_id); // Sanity
const auto type = entry->get_type();
@ -266,6 +267,6 @@ void DamageTable::erase(damage_entry_id_t damage_id)
assert(0);
}
by_id.erase(damage_id);
by_id.erase(by_id_entry);
}