Bug 1642949 - Replace uses of RemoveElementAt by RemoveLastElement/PopLastElement where possible. r=necko-reviewers,froydnj

Differential Revision: https://phabricator.services.mozilla.com/D78027
This commit is contained in:
Simon Giesecke
2020-06-10 05:49:28 +00:00
parent 133ef314b0
commit 1c59dae9e4
44 changed files with 99 additions and 176 deletions

View File

@@ -1389,8 +1389,7 @@ TextControlState::TextControlState(TextControlElement* aOwningElement)
TextControlState* TextControlState::Construct(
TextControlElement* aOwningElement) {
if (sReleasedInstances && !sReleasedInstances->IsEmpty()) {
TextControlState* state = sReleasedInstances->LastElement();
sReleasedInstances->RemoveLastElement();
TextControlState* state = sReleasedInstances->PopLastElement();
state->mTextCtrlElement = aOwningElement;
state->mBoundFrame = nullptr;
state->mSelectionProperties = SelectionProperties();