diff --git a/examples/List/DifferenceMutableAndImmutable/DifferenceMutableAndImmutable.ino b/examples/List/DifferenceMutableAndImmutable/DifferenceMutableAndImmutable.ino index dfc03b9..4c4b921 100644 --- a/examples/List/DifferenceMutableAndImmutable/DifferenceMutableAndImmutable.ino +++ b/examples/List/DifferenceMutableAndImmutable/DifferenceMutableAndImmutable.ino @@ -37,7 +37,7 @@ void setup() { Serial.print("The first element of the first list is: "); Serial.println(mutableList.get(0)); Serial.print("The first element of the second list is: "); - Serial.println(immutableList.gte(0)); + Serial.println(immutableList.get(0)); Serial.println("You see, that the first element of the first list has the the new value and the first element of the second list has not changed."); Serial.println("Elements of mutable lists can be manipulate via the same variable; immutable lists cannot!"); diff --git a/src/AbstractList.hpp b/src/AbstractList.hpp index 3464c46..6c49ad2 100644 --- a/src/AbstractList.hpp +++ b/src/AbstractList.hpp @@ -327,10 +327,6 @@ class AbstractList { * @param arr Array to fill. */ void toArray(T *arr) { - if (getSize() == 0) { - return arr; - } - for (int i = 0; i < getSize(); i++) { arr[i] = get(i); }