From 29dbd46d8b70787c942c16bf0538884a28ed4796 Mon Sep 17 00:00:00 2001 From: Syndamia Date: Sun, 8 May 2022 08:32:57 +0300 Subject: Autocommit at 08.05.2022 @ 08:32 --- src/Services/EventService.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/Services/EventService.cpp') diff --git a/src/Services/EventService.cpp b/src/Services/EventService.cpp index 5b79faa..f220089 100644 --- a/src/Services/EventService.cpp +++ b/src/Services/EventService.cpp @@ -171,7 +171,7 @@ List EventService::queryMostWatched(unsigned topN) { List result; for (unsigned i = 0; i < events.get_count(); i++) { unsigned ind = indexToInsertWhenTicketSort(result, topN, events[i].get_tickets().get_count()); - if (ind < topN) + if (ind < topN || events.get_count() < topN) result.insertAt(events[i], ind); if (result.get_count() == topN) result.removeAt(topN); -- cgit v1.3.1-23-gd82d