mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-09-13 14:39:28 +00:00
preallocate lastcontexts map
This commit is contained in:

committed by
Sveta Smirnova

parent
90ae30517a
commit
fd95589c96
@@ -22,9 +22,9 @@ func TimelineCLI(timeline types.Timeline, verbosity types.Verbosity) {
|
|||||||
// to hold the current context for each node
|
// to hold the current context for each node
|
||||||
// "keys" is needed, because iterating over a map must give a different order each time
|
// "keys" is needed, because iterating over a map must give a different order each time
|
||||||
// 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()
|
||||||
|
Reference in New Issue
Block a user