diff --git a/Jupiter/SLList.h b/Jupiter/SLList.h index cfbaa7d..e9beb46 100644 --- a/Jupiter/SLList.h +++ b/Jupiter/SLList.h @@ -169,11 +169,13 @@ template T *Jupiter::SLList::get(size_t index) const template T *Jupiter::SLList::remove(size_t index) { Jupiter::SLList::Node *t = head; - for (size_t i = 0; i != index; i++) t = t->next; + for (size_t i = 0; i != index; i++) + t = t->next; Jupiter::SLList::Node *t2 = t->next; + t->next = t2->next; T *r = t2->data; delete t2; - Jupiter::List::length--; + --Jupiter::List::length; return r; }