Closed juupje closed 1 year ago
whoops. good catch! if you wanna throw up a PR with these changes happy to merge.
I created a pull request (I think; I'm a newby to git so apologies if I messed up). And many thanks for your efforts on creating this project!
Describe the bug
The function
ListNode<T>* LinkedList<T>::getNode(int index)
will always return false. This is due to a missing statement that returnscurrent
. Moreover, the functionLinkedList<T>::add(int index, T _t)
does not assign theprev
pointer to the object that is to be inserted.Edit The function
T LinkedList<T>::remove(int index)
does not assign theprev
pointer of the next node to the node before the one that is deleted.Steps to reproduce
This seems to be of no consequence because
getNode
is not used outsideLinkedList.h
and neither are any methods that depend in it. Also, theprev
pointer in ListNode is not used outside ofLinkedList.h
.Expected behavior
Even though these bugs are currently of no consequence for the existing code, they cause issues for an alarm feature that I am attempting to implement and might cause unexpected behavior in the future.
The correct return statement of
getNode
should be:and the current code of
add
includetmp->prev = _prev;
.Setup information
Firmware version
1.10.8
Additional information about my setup is not necessary