Website Summary Files Commits Branches @commit @diff @stats
path: root / src / Generic
diff options
context:
space:
mode:
Commit1feabb8895e834a2325380719aaf11053959df7a (patch)
Author
 Syndamia <kamen.d.mladenov@protonmail.com>
2022-05-07 11:37:50 +0300
Committer
 Syndamia <kamen.d.mladenov@protonmail.com>
2022-05-07 11:37:50 +0300
Files43f62617bbfbb130b6501a2e55385fc83f85f1d4 /src/Generic
FMI-OOP-P1_TicketSystem-1feabb8895e834a2325380719aaf11053959df7a.tar
FMI-OOP-P1_TicketSystem-1feabb8895e834a2325380719aaf11053959df7a.tar.gz
FMI-OOP-P1_TicketSystem-1feabb8895e834a2325380719aaf11053959df7a.zip
Parent50c5fe08988d14e3681e6236a2c5f28c89e5edbc (diff)
Autocommit at 07.05.2022 @ 11:37
1 files changed, 4 insertions, 1 deletions
-rw-r--r--src/Generic/List/List.hpp5
diff --git a/src/Generic/List/List.hpp b/src/Generic/List/List.hpp
index c798590..d2a759f 100644
--- a/src/Generic/List/List.hpp
+++ b/src/Generic/List/List.hpp
@@ -86,7 +86,10 @@ void List<T>::add(T element) {
template <class T>
void List<T>::insertAt(T element, unsigned index) {
- if (index >= count) add(element);
+ if (index >= count) {
+ add(element);
+ return;
+ }
if (length == count) resize();
for (unsigned i = count; i > index; i--)