List: handle re-inserting

- clear sibling on removal
 - add reinsertion test case to test_list
This commit is contained in:
Daniel Agar
2020-04-17 11:56:24 -04:00
parent d6df3036cb
commit d96a841050
2 changed files with 80 additions and 0 deletions
+4
View File
@@ -95,6 +95,8 @@ public:
_head = _head->getSibling();
}
removeNode->setSibling(nullptr);
return true;
}
@@ -109,6 +111,8 @@ public:
node->setSibling(nullptr);
}
removeNode->setSibling(nullptr);
return true;
}
}