Commit d80c4b7d authored by pilgrim's avatar pilgrim Committed by Commit bot

Migrate WTF::LinkedHashSet/ListHashSet::removeLast() to ::pop_back()

As discussed on platform-architecture-dev [0], there is interest in
normalizing the methods of WTF classes to better align with std classes.

There are no functional changes.

[0] https://groups.google.com/a/chromium.org/d/topic/platform-architecture-dev/I7jnz4p1h84/discussion

BUG=662431

Review-Url: https://codereview.chromium.org/2743743002
Cr-Commit-Position: refs/heads/master@{#455792}
parent 64f24e7d
......@@ -241,7 +241,7 @@ class LinkedHashSet {
Value& back();
const Value& back() const;
void removeLast();
void pop_back();
iterator find(ValuePeekInType);
const_iterator find(ValuePeekInType) const;
......@@ -730,7 +730,7 @@ inline const T& LinkedHashSet<T, U, V, W>::back() const {
}
template <typename T, typename U, typename V, typename W>
inline void LinkedHashSet<T, U, V, W>::removeLast() {
inline void LinkedHashSet<T, U, V, W>::pop_back() {
DCHECK(!isEmpty());
m_impl.remove(static_cast<Node*>(m_anchor.m_prev));
}
......
......@@ -169,7 +169,7 @@ class ListHashSet
ValueType& back();
const ValueType& back() const;
void removeLast();
void pop_back();
iterator find(ValuePeekInType);
const_iterator find(ValuePeekInType) const;
......@@ -840,7 +840,7 @@ inline const T& ListHashSet<T, inlineCapacity, U, V>::back() const {
}
template <typename T, size_t inlineCapacity, typename U, typename V>
inline void ListHashSet<T, inlineCapacity, U, V>::removeLast() {
inline void ListHashSet<T, inlineCapacity, U, V>::pop_back() {
DCHECK(!isEmpty());
m_impl.remove(m_tail);
unlinkAndDelete(m_tail);
......
......@@ -60,7 +60,7 @@ TYPED_TEST(ListOrLinkedHashSetTest, RemoveFirst) {
list.removeFirst();
EXPECT_EQ(0, list.front());
list.removeLast();
list.pop_back();
EXPECT_EQ(2, list.back());
list.removeFirst();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment