From cd9b5262038f2ca29312fef805218aa8b95bec95 Mon Sep 17 00:00:00 2001 From: Alexander Neumann Date: Sun, 15 Jan 2017 15:27:58 +0100 Subject: [PATCH] Preallocate pack entries list --- src/restic/pack/pack.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/restic/pack/pack.go b/src/restic/pack/pack.go index be4fcc087..6666d886a 100644 --- a/src/restic/pack/pack.go +++ b/src/restic/pack/pack.go @@ -233,6 +233,8 @@ func List(k *crypto.Key, rd io.ReaderAt, size int64) (entries []restic.Blob, err hdrRd := bytes.NewReader(buf) + entries = make([]restic.Blob, 0, uint(n)/entrySize) + pos := uint(0) for { e := headerEntry{}