Skip to content

Commit 18c2da5

Browse files
pre-allocate strings.Builder for UnderscoreEscaping
Signed-off-by: warnar boekkooi <wboekkooi@impossiblecloud.com>
1 parent 6b0f374 commit 18c2da5

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
@@ -426,6 +426,7 @@ func EscapeName(name string, scheme EscapingScheme) string {
426426
if IsValidLegacyMetricName(name) {
427427
return name
428428
}
429+
escaped.Grow(len(name))
429430
for i, b := range name {
430431
if isValidLegacyRune(b, i) {
431432
escaped.WriteRune(b)

0 commit comments

Comments
 (0)