Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of LinkedList by
Diff: LinkedList.cpp
- Revision:
- 5:28e11c75b433
- Parent:
- 4:59b2aa82b517
- Child:
- 6:e3ab7684c395
--- 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)
