diff options
author | Moonchild <moonchild@palemoon.org> | 2021-08-12 11:30:26 +0000 |
---|---|---|
committer | Moonchild <moonchild@palemoon.org> | 2021-08-12 11:30:26 +0000 |
commit | 59053eabf50bc09a372de66584ee6cb52536ce36 (patch) | |
tree | 7b85b4bc966e46c202a0ed499fcc62ec6ca078fa /mfbt | |
parent | 3bf69d43c880b416264bd7cf23e80c09124db627 (diff) | |
download | aura-central-59053eabf50bc09a372de66584ee6cb52536ce36.tar.gz |
[MFBT] Convert debug asserts to early returns for situations that should
never occur.
Diffstat (limited to 'mfbt')
-rw-r--r-- | mfbt/LinkedList.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/mfbt/LinkedList.h b/mfbt/LinkedList.h index a099d7597..9d04e64c7 100644 --- a/mfbt/LinkedList.h +++ b/mfbt/LinkedList.h @@ -327,7 +327,8 @@ private: void setNextUnsafe(RawType aElem) { LinkedListElement *listElem = static_cast<LinkedListElement*>(aElem); - MOZ_ASSERT(!listElem->isInList()); + if (listElem->isInList()) + return; listElem->mNext = this->mNext; listElem->mPrev = this; @@ -344,7 +345,8 @@ private: void setPreviousUnsafe(RawType aElem) { LinkedListElement<T>* listElem = static_cast<LinkedListElement<T>*>(aElem); - MOZ_ASSERT(!listElem->isInList()); + if (listElem->isInList()) + return; listElem->mNext = this; listElem->mPrev = this->mPrev; |