From e68c3a4e62a73906baebea165098eb8baaff7a8f Mon Sep 17 00:00:00 2001 From: Michael Eischer Date: Thu, 26 May 2022 16:13:41 +0200 Subject: [PATCH] repository: simplify CreateIndexFromPacks --- internal/repository/repository.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/internal/repository/repository.go b/internal/repository/repository.go index 01a7cad8a..cab0dda83 100644 --- a/internal/repository/repository.go +++ b/internal/repository/repository.go @@ -643,7 +643,6 @@ func (r *Repository) CreateIndexFromPacks(ctx context.Context, packsize map[rest return nil }) - idx := NewIndex() // a worker receives an pack ID from ch, reads the pack contents, and adds them to idx worker := func() error { for fi := range ch { @@ -654,7 +653,7 @@ func (r *Repository) CreateIndexFromPacks(ctx context.Context, packsize map[rest invalid = append(invalid, fi.ID) m.Unlock() } - idx.StorePack(fi.ID, entries) + r.idx.StorePack(fi.ID, entries) p.Add(1) } @@ -671,9 +670,6 @@ func (r *Repository) CreateIndexFromPacks(ctx context.Context, packsize map[rest return invalid, errors.Fatal(err.Error()) } - // Add idx to MasterIndex - r.idx.Insert(idx) - return invalid, nil }