From 2d6b2fcbcf1957761cebeb7f120d596648721642 Mon Sep 17 00:00:00 2001 From: Syndamia Date: Sun, 8 May 2022 08:43:01 +0300 Subject: Autocommit at 08.05.2022 @ 08:43 --- 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 f220089..2766d38 100644 --- a/src/Services/EventService.cpp +++ b/src/Services/EventService.cpp @@ -164,7 +164,7 @@ unsigned indexToInsertWhenTicketSort(const List& elem, unsigned topN, uns if (elem[i].get_tickets().get_count() <= ticketCount) return i; } - return topN; + return (topN >= elem.get_count()) ? topN : elem.get_count(); } List EventService::queryMostWatched(unsigned topN) { -- cgit v1.3.1-23-gd82d