Skip to content

Commit

Permalink
Merge pull request #11228 from stiopaa1/osd_pg_removeUnneededCount1
Browse files Browse the repository at this point in the history
osd/PG.cc: remove unneeded use of count

Reviewed-by: Sage Weil <sage@redhat.com>
  • Loading branch information
liewegas committed Sep 26, 2016
2 parents 05c4c9e + 921aa6e commit 78e92a9
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/osd/PG.cc
Expand Up @@ -87,9 +87,6 @@ void PG::get(const char* tag)
ref++;
#ifdef PG_DEBUG_REFS
Mutex::Locker l(_ref_id_lock);
if (!_tag_counts.count(tag)) {
_tag_counts[tag] = 0;
}
_tag_counts[tag]++;
#endif
}
Expand All @@ -99,10 +96,11 @@ void PG::put(const char* tag)
#ifdef PG_DEBUG_REFS
{
Mutex::Locker l(_ref_id_lock);
assert(_tag_counts.count(tag));
_tag_counts[tag]--;
if (_tag_counts[tag] == 0) {
_tag_counts.erase(tag);
auto tag_counts_entry = _tag_counts.find(tag);
assert(_tag_counts_entry != _tag_counts.end());
--tag_counts_entry->second;
if (tag_counts_entry->second == 0) {
_tag_counts.erase(tag_counts_entry);
}
}
#endif
Expand Down

0 comments on commit 78e92a9

Please sign in to comment.