Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(219)

Unified Diff: third_party/WebKit/Source/wtf/Deque.h

Issue 2747213002: Migrate WTF::Deque::last() to ::back() (Closed)
Patch Set: rebase Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/wtf/Deque.h
diff --git a/third_party/WebKit/Source/wtf/Deque.h b/third_party/WebKit/Source/wtf/Deque.h
index 43f8559fb317780fdb7462a84a44c67f784060e6..c7c2251c1aa387ce975568ba47b00809a44a25d7 100644
--- a/third_party/WebKit/Source/wtf/Deque.h
+++ b/third_party/WebKit/Source/wtf/Deque.h
@@ -99,11 +99,11 @@ class Deque : public ConditionalDestructor<Deque<T, INLINE_CAPACITY, Allocator>,
}
T takeFirst();
- T& last() {
+ T& back() {
DCHECK_NE(m_start, m_end);
return *(--end());
}
- const T& last() const {
+ const T& back() const {
DCHECK_NE(m_start, m_end);
return *(--end());
}
@@ -140,8 +140,6 @@ class Deque : public ConditionalDestructor<Deque<T, INLINE_CAPACITY, Allocator>,
void pop_back();
void pop_front();
bool empty() const { return isEmpty(); }
- T& back() { return last(); }
- const T& back() const { return last(); }
template <typename... Args>
void emplace_back(Args&&...);
template <typename... Args>
@@ -489,7 +487,7 @@ inline T Deque<T, inlineCapacity, Allocator>::takeFirst() {
template <typename T, size_t inlineCapacity, typename Allocator>
inline T Deque<T, inlineCapacity, Allocator>::takeLast() {
- T oldLast = std::move(last());
+ T oldLast = std::move(back());
pop_back();
return oldLast;
}

Powered by Google App Engine
This is Rietveld 408576698