Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ PROJECT_NAME = "Arduino List Library"
# could be handy for archiving the generated documentation or if some version
# control system is used.

PROJECT_NUMBER = 1.0.0
PROJECT_NUMBER = 1.0.1

# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a
Expand Down
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=List
version=1.0.0
version=1.0.1
author=Niklas Kaaf <nkaaf@protonmail.com>
maintainer=Niklas Kaaf <nkaaf@protonmail.com>
sentence=The Ultimate Collection of Lists
Expand Down
7 changes: 6 additions & 1 deletion src/AbstractList.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,9 @@ template <typename T> class AbstractList {
virtual void remove(int index) = 0;

/*!
* @brief Get a pointer to the entry at the given index.
* @brief Get a pointer to the entry at the given index. If the given index
* does not exists in the list or the list is immutable, null will be
* returned.
* @note If you only want to get the value, use getValue().
*
* @param index Index of the element to get.
Expand All @@ -99,7 +101,10 @@ template <typename T> class AbstractList {

/*!
* @brief Get the plain value at the given index.
* @note Be safe, that the given index exists and the list is mutable,
* otherwise the program will crash here!
* @see get()
* @todo Rewrite this to let the program not crash!
*
* @param index Index of element to get.
* @return Value.
Expand Down
2 changes: 1 addition & 1 deletion src/SingleLinkedList.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ template <typename T> class SingleLinkedList : public AbstractList<T> {
}

T *get(int index) override {
if (this->isIndexOutOfBounds(index)) {
if (!this->isMutable() || this->isIndexOutOfBounds(index)) {
return nullptr;
}

Expand Down