Sergei G / LinkedList

Dependents:   JobScheduler

Fork of LinkedList by Sam Grove

Revision:
5:28e11c75b433
Parent:
4:59b2aa82b517
Child:
6:e3ab7684c395
diff -r 59b2aa82b517 -r 28e11c75b433 LinkedList.cpp
--- a/LinkedList.cpp	Wed Apr 10 06:17:21 2013 +0000
+++ b/LinkedList.cpp	Mon May 13 04:38:05 2013 +0000
@@ -37,10 +37,7 @@
 LinkedList<retT>::~LinkedList()
 {
     // free any memory that is on the heap
-    while(0 != length())
-    {
-        LinkedList::remove(1);
-    }
+    while(remove(1) != NULL);
 
     return;
 }
@@ -133,7 +130,7 @@
     retT *current = _head;
     retT *prev = 0;
     // make sure we have an item to remove
-    if ((loc < length()) && (loc > 0))
+    if ((loc <= length()) && (loc > 0))
     {
         // move to the item we want to delete
         if (1 == loc)