зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1644640 - Rename RemoveElementsAt(const_iterator, const_iterator) to RemoveElementsRange. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D79033
This commit is contained in:
Родитель
2e17d6aa5e
Коммит
4ab55413a3
|
@ -12630,7 +12630,7 @@ void ConnectionPool::ScheduleQueuedTransactions(ThreadInfo aThreadInfo) {
|
|||
/* aFromQueuedTransactions */ true);
|
||||
});
|
||||
|
||||
mQueuedTransactions.RemoveElementsAt(mQueuedTransactions.begin(), foundIt);
|
||||
mQueuedTransactions.RemoveElementsRange(mQueuedTransactions.begin(), foundIt);
|
||||
|
||||
AdjustIdleTimer();
|
||||
}
|
||||
|
|
|
@ -96,7 +96,7 @@ nsCommandLine::RemoveArguments(int32_t aStart, int32_t aEnd) {
|
|||
NS_ENSURE_ARG_MIN(aStart, 0);
|
||||
NS_ENSURE_ARG_MAX(uint32_t(aEnd) + 1, mArgs.Length());
|
||||
|
||||
mArgs.RemoveElementsAt(mArgs.begin() + aStart, mArgs.begin() + aEnd + 1);
|
||||
mArgs.RemoveElementsRange(mArgs.begin() + aStart, mArgs.begin() + aEnd + 1);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
|
|
@ -985,7 +985,7 @@ template <class T>
|
|||
static void Erase(FallibleTArray<T>* array,
|
||||
typename FallibleTArray<T>::iterator& iterStart,
|
||||
typename FallibleTArray<T>::iterator& iterEnd) {
|
||||
array->RemoveElementsAt(iterStart, iterEnd);
|
||||
array->RemoveElementsRange(iterStart, iterEnd);
|
||||
}
|
||||
|
||||
// Find items matching between |subs| and |adds|, and remove them,
|
||||
|
|
|
@ -1762,7 +1762,8 @@ class nsTArray_Impl
|
|||
// std::vector::erase.
|
||||
// @param first iterator to the first of elements to remove
|
||||
// @param last iterator to the last of elements to remove
|
||||
const_iterator RemoveElementsAt(const_iterator first, const_iterator last) {
|
||||
const_iterator RemoveElementsRange(const_iterator first,
|
||||
const_iterator last) {
|
||||
MOZ_ASSERT(first.GetArray() == this);
|
||||
MOZ_ASSERT(last.GetArray() == this);
|
||||
MOZ_ASSERT(last.GetIndex() >= first.GetIndex());
|
||||
|
|
|
@ -800,11 +800,11 @@ TEST(TArray, RemoveElementAt_ByIterator)
|
|||
ASSERT_EQ(expected, array);
|
||||
}
|
||||
|
||||
TEST(TArray, RemoveElementsAt_ByIterator)
|
||||
TEST(TArray, RemoveElementsRange_ByIterator)
|
||||
{
|
||||
nsTArray<int> array{1, 2, 3, 4};
|
||||
const auto it = std::find(array.begin(), array.end(), 3);
|
||||
const auto itAfter = array.RemoveElementsAt(it, array.end());
|
||||
const auto itAfter = array.RemoveElementsRange(it, array.end());
|
||||
|
||||
// Based on the implementation of the iterator, we could compare it and
|
||||
// itAfter, but we should not rely on such implementation details.
|
||||
|
|
Загрузка…
Ссылка в новой задаче