From 66f0cd8fe55661376e1ac490397f9e7affbe5804 Mon Sep 17 00:00:00 2001 From: Eduard Urbach Date: Mon, 4 Dec 2017 22:23:31 +0100 Subject: [PATCH] Minor performance improvement --- pages/compare/animelist.go | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/pages/compare/animelist.go b/pages/compare/animelist.go index a0b2a4a7..eb7b7249 100644 --- a/pages/compare/animelist.go +++ b/pages/compare/animelist.go @@ -33,7 +33,10 @@ func AnimeList(ctx *aero.Context) string { countA := 0 countB := 0 - for _, item := range a.AnimeList().Items { + animeListA := a.AnimeList() + animeListB := b.AnimeList() + + for _, item := range animeListA.Items { if item.Status == arn.AnimeListStatusPlanned { continue } @@ -43,11 +46,11 @@ func AnimeList(ctx *aero.Context) string { comparisons = append(comparisons, &utils.Comparison{ Anime: item.Anime(), ItemA: item, - ItemB: b.AnimeList().Find(item.AnimeID), + ItemB: animeListB.Find(item.AnimeID), }) } - for _, item := range b.AnimeList().Items { + for _, item := range animeListB.Items { if item.Status == arn.AnimeListStatusPlanned { continue } @@ -60,7 +63,7 @@ func AnimeList(ctx *aero.Context) string { comparisons = append(comparisons, &utils.Comparison{ Anime: item.Anime(), - ItemA: a.AnimeList().Find(item.AnimeID), + ItemA: animeListA.Find(item.AnimeID), ItemB: item, }) }