Skip to content

Commit 0857633

Browse files
sashamelentyevgopherbot
authored andcommitted
runtime/pprof: set labelMap length
Change-Id: If09094e72161f2c5da9102706781524e32f87782 GitHub-Last-Rev: 89949bc GitHub-Pull-Request: #54855 Reviewed-on: https://go-review.googlesource.com/c/go/+/428234 Auto-Submit: Ian Lance Taylor <[email protected]> Run-TryBot: Ian Lance Taylor <[email protected]> Run-TryBot: Ian Lance Taylor <[email protected]> Reviewed-by: Cherry Mui <[email protected]> TryBot-Result: Gopher Robot <[email protected]> Reviewed-by: Ian Lance Taylor <[email protected]>
1 parent c91b100 commit 0857633

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/runtime/pprof/label.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ func (l *labelMap) String() string {
5757
// WithLabels returns a new context.Context with the given labels added.
5858
// A label overwrites a prior label with the same key.
5959
func WithLabels(ctx context.Context, labels LabelSet) context.Context {
60-
childLabels := make(labelMap)
6160
parentLabels := labelValue(ctx)
61+
childLabels := make(labelMap, len(parentLabels))
6262
// TODO(matloob): replace the map implementation with something
6363
// more efficient so creating a child context WithLabels doesn't need
6464
// to clone the map.

0 commit comments

Comments
 (0)