aboutsummaryrefslogtreecommitdiff
path: root/src/internal/trace/parser.go
diff options
context:
space:
mode:
authorShulhan <m.shulhan@gmail.com>2023-05-02 01:06:11 +0700
committerShulhan <m.shulhan@gmail.com>2024-01-25 04:01:14 +0700
commit8096b47dd09fcda8712f7a3c07dced5244123a4d (patch)
tree26339e20861f0d89cff1cf3dc763d7b99b4aaee8 /src/internal/trace/parser.go
parent54386c4a7e68ab281545116220600f670e8f9e14 (diff)
downloadgo-8096b47dd09fcda8712f7a3c07dced5244123a4d.tar.xz
all: prealloc slice with possible minimum capabilities
Diffstat (limited to 'src/internal/trace/parser.go')
-rw-r--r--src/internal/trace/parser.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/internal/trace/parser.go b/src/internal/trace/parser.go
index 3bbfbebab4..a263421792 100644
--- a/src/internal/trace/parser.go
+++ b/src/internal/trace/parser.go
@@ -914,7 +914,7 @@ func symbolize(events []*Event, bin string) error {
// Write all pcs to addr2line.
// Need to copy pcs to an array, because map iteration order is non-deterministic.
- var pcArray []uint64
+ pcArray := make([]uint64, 0, len(pcs))
for pc := range pcs {
pcArray = append(pcArray, pc)
_, err := fmt.Fprintf(in, "0x%x\n", pc-1)