aboutsummaryrefslogtreecommitdiff
path: root/src/internal
diff options
context:
space:
mode:
Diffstat (limited to 'src/internal')
-rw-r--r--src/internal/profile/profile.go2
-rw-r--r--src/internal/trace/traceviewer/mmu.go2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/internal/profile/profile.go b/src/internal/profile/profile.go
index afd1dd72ee..c8529d916d 100644
--- a/src/internal/profile/profile.go
+++ b/src/internal/profile/profile.go
@@ -507,7 +507,7 @@ type Demangler func(name []string) (map[string]string, error)
// it will silently preserve the original names in case of any errors.
func (p *Profile) Demangle(d Demangler) error {
// Collect names to demangle.
- var names []string
+ names := make([]string, 0, len(p.Function))
for _, fn := range p.Function {
names = append(names, fn.SystemName)
}
diff --git a/src/internal/trace/traceviewer/mmu.go b/src/internal/trace/traceviewer/mmu.go
index 190ce5afca..3de3b7fc2c 100644
--- a/src/internal/trace/traceviewer/mmu.go
+++ b/src/internal/trace/traceviewer/mmu.go
@@ -385,7 +385,7 @@ func (m *mmu) HandleDetails(w http.ResponseWriter, r *http.Request) {
worst := mmuCurve.Examples(time.Duration(window), 10)
// Construct a link for each window.
- var links []linkedUtilWindow
+ links := make([]linkedUtilWindow, 0, len(worst))
for _, ui := range worst {
links = append(links, m.newLinkedUtilWindow(ui, time.Duration(window)))
}