Skip to content

Commit

Permalink
expfmt: Avoid copying mutex in proto message
Browse files Browse the repository at this point in the history
Signed-off-by: beorn7 <beorn@grafana.com>
  • Loading branch information
beorn7 authored and SuperQ committed May 4, 2023
1 parent 27a8fa5 commit 5e8c998
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion expfmt/decode.go
Expand Up @@ -132,7 +132,10 @@ func (d *textDecoder) Decode(v *dto.MetricFamily) error {
}
// Pick off one MetricFamily per Decode until there's nothing left.
for key, fam := range d.fams {
*v = *fam
v.Name = fam.Name
v.Help = fam.Help
v.Type = fam.Type
v.Metric = fam.Metric
delete(d.fams, key)
return nil
}
Expand Down

0 comments on commit 5e8c998

Please sign in to comment.