mirror of https://github.com/databricks/cli.git
added preallocation of size
This commit is contained in:
parent
265e517126
commit
08826094ce
|
@ -59,13 +59,13 @@ var lsCmd = &cobra.Command{
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
jsonDirEntries := make([]jsonDirEntry, 0)
|
jsonDirEntries := make([]jsonDirEntry, len(entries))
|
||||||
for _, entry := range entries {
|
for i, entry := range entries {
|
||||||
jsonDirEntry, err := toJsonDirEntry(entry)
|
jsonDirEntry, err := toJsonDirEntry(entry)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
jsonDirEntries = append(jsonDirEntries, *jsonDirEntry)
|
jsonDirEntries[i] = *jsonDirEntry
|
||||||
}
|
}
|
||||||
sort.Slice(jsonDirEntries, func(i, j int) bool {
|
sort.Slice(jsonDirEntries, func(i, j int) bool {
|
||||||
return jsonDirEntries[i].Name < jsonDirEntries[j].Name
|
return jsonDirEntries[i].Name < jsonDirEntries[j].Name
|
||||||
|
|
Loading…
Reference in New Issue