diff --git a/src/bees.cc b/src/bees.cc index 08c3fd7..467f15f 100644 --- a/src/bees.cc +++ b/src/bees.cc @@ -276,9 +276,10 @@ BeesStatTmpl::add_count(string idx, size_t amount) { unique_lock lock(m_mutex); if (!m_stats_map.count(idx)) { - m_stats_map[idx] = 0; + m_stats_map[idx] = amount; + } else { + m_stats_map[idx] += amount; } - m_stats_map.at(idx) += amount; } template