// If this is the last metric with this name, remove the type as well.
if (!((it != metrics.begin() && prev(it)->first.name == name) ||
// If this is the last metric with this name, remove the type as well.
if (!((it != metrics.begin() && prev(it)->first.name == name) ||