Skip to content

Commit 5e8c998

Browse files
beorn7SuperQ
authored andcommitted
expfmt: Avoid copying mutex in proto message
Signed-off-by: beorn7 <[email protected]>
1 parent 27a8fa5 commit 5e8c998

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

expfmt/decode.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,10 @@ func (d *textDecoder) Decode(v *dto.MetricFamily) error {
132132
}
133133
// Pick off one MetricFamily per Decode until there's nothing left.
134134
for key, fam := range d.fams {
135-
*v = *fam
135+
v.Name = fam.Name
136+
v.Help = fam.Help
137+
v.Type = fam.Type
138+
v.Metric = fam.Metric
136139
delete(d.fams, key)
137140
return nil
138141
}

0 commit comments

Comments
 (0)