2
2
mirror of https://github.com/octoleo/restic.git synced 2024-12-22 10:58:55 +00:00

improved slice copying

This commit is contained in:
Alexandr Bruyako 2019-06-30 23:56:36 +03:00
parent 02014be76c
commit 8b22fe29cf

View File

@ -22,10 +22,8 @@ func Register(ns string, cfg interface{}) {
// List returns a list of all registered options (using Register()).
func List() (list []Help) {
list = make([]Help, 0, len(opts))
for _, opt := range opts {
list = append(list, opt)
}
list = make([]Help, len(opts))
copy(list, opts)
return list
}