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 10:46:14 +00:00
parent c9868cda57
commit 00eddcee05
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();