Commit e9e2aa6a authored by Steven Allen's avatar Steven Allen

avoid allocating for interface conversions on clear

parent 42df1851
...@@ -75,7 +75,8 @@ func (r *MeterRegistry) ForEach(iterFunc func(string, *Meter)) { ...@@ -75,7 +75,8 @@ func (r *MeterRegistry) ForEach(iterFunc func(string, *Meter)) {
// Clear removes all meters from the registry. // Clear removes all meters from the registry.
func (r *MeterRegistry) Clear() { func (r *MeterRegistry) Clear() {
r.ForEach(func(name string, _meter *Meter) { r.meters.Range(func(k, v interface{}) bool {
r.Remove(name) r.meters.Delete(k)
return true
}) })
} }
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment