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
commitfa49002626ffa4894fc685536ae23251400481be (patch)
tree7b85b4bc966e46c202a0ed499fcc62ec6ca078fa /mfbt
parentca1a84cb93062f83cc5dd551e098b42b6833994d (diff)
downloaduxp-fa49002626ffa4894fc685536ae23251400481be.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 a099d7597a..9d04e64c77 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;