Radu-Adrian Marcu / Mbed OS SOFT253_GroupA_AssignmentRepo

Dependencies:   LPS25H hts221

Fork of SOFT253_Template_Weather_OS_54 by Stage-1 Students SoCEM

Branch:
feature/listOptimisation
Revision:
62:9cea49a2600d
Parent:
61:330fae754769
Child:
63:cb7b9d2ccfa5
diff -r 330fae754769 -r 9cea49a2600d LinkedList.cpp
--- a/LinkedList.cpp	Fri Apr 07 12:41:37 2017 +0000
+++ b/LinkedList.cpp	Fri Apr 07 12:43:03 2017 +0000
@@ -68,15 +68,7 @@
 }
 void LinkedList::ListAll()
 {
-    Node *n = head;
-    int i = 1;
-    while(n->next != NULL)
-    {
-        char *ptr = n->measure.date.ToString();
-        printf("%i. %s : T: %f | H: %f | P: %f |\r\n",i,ptr ,n->measure.temperature, n->measure.humidity, n->measure.pressure);
-        n = n->next;   
-        i++;
-    }   
+    ListX(currentSize);
 }
 void LinkedList::ListX(int x)
 {
@@ -92,15 +84,7 @@
 }
 void LinkedList::DeleteAll()
 {
-    while(head->next != NULL)
-    {
-           Node *n = head;
-           head = head -> next;
-           
-           mpool.free(n);
-           
-           currentSize = 0;
-    }   
+    DeleteX(currentSize);
 }
 void LinkedList::DeleteX(int x)
 {