diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2018-09-12 18:49:09 +1000 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2018-09-12 18:49:09 +1000 |
commit | 35cae80de962ba17a489c3a432c9f0db5149158c (patch) | |
tree | a698e23f368c6914f3b6c629a29dd33213771625 /pkg/gui | |
parent | 31c33dfdcb4f8e27a8b50493876b17825c25c0ec (diff) |
more efficient building of branch displaystrings
Diffstat (limited to 'pkg/gui')
-rw-r--r-- | pkg/gui/branches_panel.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/pkg/gui/branches_panel.go b/pkg/gui/branches_panel.go index d164003e5..659725ef2 100644 --- a/pkg/gui/branches_panel.go +++ b/pkg/gui/branches_panel.go @@ -152,9 +152,9 @@ func (gui *Gui) refreshBranches(g *gocui.Gui) error { } gui.State.Branches = builder.Build() v.Clear() - displayStrings := []string{} - for _, branch := range gui.State.Branches { - displayStrings = append(displayStrings, branch.GetDisplayString()) + displayStrings := make([]string, len(gui.State.Branches)) + for i, branch := range gui.State.Branches { + displayStrings[i] = branch.GetDisplayString() } fmt.Fprint(v, strings.Join(displayStrings, "\n")) gui.resetOrigin(v) |