preallocate lastcontexts map

This commit is contained in:
Yoann La Cancellera
2023-11-24 10:25:22 +01:00
committed by Sveta Smirnova
parent 90ae30517a
commit fd95589c96

View File

@@ -24,7 +24,7 @@ func TimelineCLI(timeline types.Timeline, verbosity types.Verbosity) {
// a slice keeps its order // a slice keeps its order
keys, currentContext := initKeysContext(timeline) // currentcontext to follow when important thing changed keys, currentContext := initKeysContext(timeline) // currentcontext to follow when important thing changed
latestContext := timeline.GetLatestContextsByNodes() // so that we have fully updated context when we print latestContext := timeline.GetLatestContextsByNodes() // so that we have fully updated context when we print
lastContext := map[string]types.LogCtx{} // just to follow when important thing changed lastContext := make(map[string]types.LogCtx, len(timeline)) // just to follow when important thing changed
w := tabwriter.NewWriter(os.Stdout, 8, 8, 3, ' ', tabwriter.DiscardEmptyColumns) w := tabwriter.NewWriter(os.Stdout, 8, 8, 3, ' ', tabwriter.DiscardEmptyColumns)
defer w.Flush() defer w.Flush()