mirror of
https://github.com/restic/restic.git
synced 2026-11-22 05:14:23 +00:00
restic: speed up repository config initialization in tests
Avoid redundant polynomial generation, which takes a millisecond or so.
This commit is contained in:
1 parent
440d925467
commit
1174e97b30
3 files changed
+10
-9
No files matched your search
@@ -919,13 +919,10 @@ func (r *Repository) Init(ctx context.Context, version uint, password string, ch
|
||||
return err
|
||||
}
|
||||
|
||||
cfg, err := restic.CreateConfig(version)
|
||||
cfg, err := restic.CreateConfig(version, chunkerPolynomial)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if chunkerPolynomial != nil {
|
||||
cfg.ChunkerPolynomial = *chunkerPolynomial
|
||||
}
|
||||
|
||||
return r.init(ctx, password, cfg)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user