Website Summary Files Commits Branches @commit @diff @stats
path: root / src / Services / EventService.cpp
diff options
context:
space:
mode:
1 files changed, 1 insertions, 1 deletions
-rw-r--r--src/Services/EventService.cpp2
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) {