Website Summary Files Commits Branches @commit @diff @stats
path: root / src / Services / EventService.cpp
diff options
context:
space:
mode:
Commit2d6b2fcbcf1957761cebeb7f120d596648721642 (patch)
Author
 Syndamia <kamen.d.mladenov@protonmail.com>
2022-05-08 08:43:01 +0300
Committer
 Syndamia <kamen.d.mladenov@protonmail.com>
2022-05-08 08:43:01 +0300
Files9803beea73a2010ea21a0411ae0b9c02f271fcd7 /src/Services/EventService.cpp
FMI-OOP-P1_TicketSystem-2d6b2fcbcf1957761cebeb7f120d596648721642.tar
FMI-OOP-P1_TicketSystem-2d6b2fcbcf1957761cebeb7f120d596648721642.tar.gz
FMI-OOP-P1_TicketSystem-2d6b2fcbcf1957761cebeb7f120d596648721642.zip
Parentad74e975c5ef569a947b5c40e588004052505f3b (diff)
Autocommit at 08.05.2022 @ 08:43
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) {