зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1398543 - Add missing condition in DoublyLinkedList::ElementNotInList. r=froydnj
--HG-- extra : rebase_source : fa07b148bd0d7e7428e70fb8a05edb5792836135
This commit is contained in:
Родитель
507bd6716f
Коммит
18212266ea
|
@ -117,8 +117,15 @@ class DoublyLinkedList final
|
|||
return (mHead != nullptr) == (mTail != nullptr);
|
||||
}
|
||||
|
||||
static bool ElementNotInList(T* aElm) {
|
||||
return !SiblingAccess::GetNext(aElm) && !SiblingAccess::GetPrev(aElm);
|
||||
bool ElementNotInList(T* aElm) {
|
||||
if (!SiblingAccess::GetNext(aElm) && !SiblingAccess::GetPrev(aElm)) {
|
||||
// Both mNext and mPrev being NULL can mean two things:
|
||||
// - the element is not in the list.
|
||||
// - the element is the first and only element in the list.
|
||||
// So check for the latter.
|
||||
return mHead != aElm;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public:
|
||||
|
|
Загрузка…
Ссылка в новой задаче