Bug 1359653: Part 3 - Add a clear() method and move asssignment operator to AutoCleanLinkedList. r=waldo

MozReview-Commit-ID: 2bUTMPviJzg

--HG--
extra : source : b49bd726c8a6e955c672df17b2b9134ab3ad34d5
This commit is contained in:
Kris Maglione 2017-05-02 17:54:18 -07:00
parent 16393582a7
commit 7d8720d597

View File

@ -647,6 +647,17 @@ class AutoCleanLinkedList : public LinkedList<T>
{
public:
~AutoCleanLinkedList()
{
clear();
}
AutoCleanLinkedList& operator=(AutoCleanLinkedList&& aOther)
{
LinkedList<T>::operator=(Forward<LinkedList<T>>(aOther));
return *this;
}
void clear()
{
while (T* element = this->popFirst()) {
delete element;