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 committed May 3, 2023
1 parent 16341ac commit e9d252b
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 e9d252b

Please sign in to comment.