From 0728c0050d82171659474900c407e1b6dcee43a5 Mon Sep 17 00:00:00 2001 From: Michael Muré Date: Sun, 2 Sep 2018 16:36:48 +0200 Subject: cache: provide a generic bug sorting function --- termui/bug_table.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'termui/bug_table.go') diff --git a/termui/bug_table.go b/termui/bug_table.go index 00b0ffb4..55c7a2d5 100644 --- a/termui/bug_table.go +++ b/termui/bug_table.go @@ -212,7 +212,7 @@ func (bt *bugTable) disable(g *gocui.Gui) error { } func (bt *bugTable) paginate(max int) error { - bt.allIds = bt.repo.AllBugsOrderByCreation() + bt.allIds = bt.repo.AllBugsId(cache.OrderByCreation, cache.OrderAscending) return bt.doPaginate(max) } @@ -355,8 +355,6 @@ func (bt *bugTable) cursorClamp(v *gocui.View) error { func (bt *bugTable) nextPage(g *gocui.Gui, v *gocui.View) error { _, max := v.Size() - bt.allIds = bt.repo.AllBugsOrderByCreation() - if bt.pageCursor+max >= len(bt.allIds) { return nil } @@ -369,8 +367,6 @@ func (bt *bugTable) nextPage(g *gocui.Gui, v *gocui.View) error { func (bt *bugTable) previousPage(g *gocui.Gui, v *gocui.View) error { _, max := v.Size() - bt.allIds = bt.repo.AllBugsOrderByCreation() - bt.pageCursor = maxInt(0, bt.pageCursor-max) return bt.doPaginate(max) -- cgit