From 520dd589995ce84204559b1628f5cb28f45ea93f Mon Sep 17 00:00:00 2001 From: jguer Date: Mon, 27 Jul 2020 00:57:52 +0200 Subject: [PATCH] style(cmd): remove useless filtering --- cmd.go | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/cmd.go b/cmd.go index e0b3541b..de00d87a 100644 --- a/cmd.go +++ b/cmd.go @@ -197,18 +197,22 @@ func handleVersion() { } func lastBuildTime(alpmHandle *alpm.Handle) time.Time { - pkgs, _, _, _, err := query.FilterPackages(alpmHandle) + dbList, err := alpmHandle.SyncDBs() if err != nil { return time.Now() } var lastTime time.Time - for _, pkg := range pkgs { - thisTime := pkg.BuildDate() - if thisTime.After(lastTime) { - lastTime = thisTime - } - } + _ = dbList.ForEach(func(db alpm.DB) error { + _ = db.PkgCache().ForEach(func(pkg alpm.Package) error { + thisTime := pkg.BuildDate() + if thisTime.After(lastTime) { + lastTime = thisTime + } + return nil + }) + return nil + }) return lastTime }