diff options
Autocommit at 08.05.2022 @ 08:43
1 files changed, 1 insertions, 1 deletions
| -rw-r--r-- | src/Services/EventService.cpp | 2 |
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<Event>& 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<Event> EventService::queryMostWatched(unsigned topN) { |
