summaryrefslogtreecommitdiff
path: root/mfbt
diff options
context:
space:
mode:
authorMoonchild <moonchild@palemoon.org>2021-08-12 11:30:26 +0000
committerMoonchild <moonchild@palemoon.org>2021-08-12 11:30:26 +0000
commit59053eabf50bc09a372de66584ee6cb52536ce36 (patch)
tree7b85b4bc966e46c202a0ed499fcc62ec6ca078fa /mfbt
parent3bf69d43c880b416264bd7cf23e80c09124db627 (diff)
downloadaura-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.h6
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;