Skip to content

Commit e1f4bae

Browse files
pre-allocate strings.Builder for UnderscoreEscaping
Signed-off-by: warnar boekkooi <[email protected]>
1 parent d8c70ff commit e1f4bae

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

model/metric.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -429,6 +429,7 @@ func EscapeName(name string, scheme EscapingScheme) string {
429429
if IsValidLegacyMetricName(name) {
430430
return name
431431
}
432+
escaped.Grow(len(name))
432433
for i, b := range name {
433434
if isValidLegacyRune(b, i) {
434435
escaped.WriteRune(b)

0 commit comments

Comments
 (0)