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

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

Issue 1611343002: wtf reformat test Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: pydent Created 4 years, 11 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
« no previous file with comments | « third_party/WebKit/Source/wtf/DequeTest.cpp ('k') | third_party/WebKit/Source/wtf/DynamicAnnotations.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/wtf/DoublyLinkedList.h
diff --git a/third_party/WebKit/Source/wtf/DoublyLinkedList.h b/third_party/WebKit/Source/wtf/DoublyLinkedList.h
index 44402340c02a30d4de5c630711a02c4d38c57012..14cd2187a49d1c078ebac7ba7e9604f6a2710639 100644
--- a/third_party/WebKit/Source/wtf/DoublyLinkedList.h
+++ b/third_party/WebKit/Source/wtf/DoublyLinkedList.h
@@ -31,165 +31,165 @@
namespace WTF {
// This class allows nodes to share code without dictating data member layout.
-template<typename T> class DoublyLinkedListNode {
-public:
- DoublyLinkedListNode();
+template <typename T>
+class DoublyLinkedListNode {
+ public:
+ DoublyLinkedListNode();
- void setPrev(T*);
- void setNext(T*);
+ void setPrev(T*);
+ void setNext(T*);
- T* prev() const;
- T* next() const;
+ T* prev() const;
+ T* next() const;
};
-template<typename T> inline DoublyLinkedListNode<T>::DoublyLinkedListNode()
-{
- setPrev(0);
- setNext(0);
+template <typename T>
+inline DoublyLinkedListNode<T>::DoublyLinkedListNode() {
+ setPrev(0);
+ setNext(0);
}
-template<typename T> inline void DoublyLinkedListNode<T>::setPrev(T* prev)
-{
- static_cast<T*>(this)->m_prev = prev;
+template <typename T>
+inline void DoublyLinkedListNode<T>::setPrev(T* prev) {
+ static_cast<T*>(this)->m_prev = prev;
}
-template<typename T> inline void DoublyLinkedListNode<T>::setNext(T* next)
-{
- static_cast<T*>(this)->m_next = next;
+template <typename T>
+inline void DoublyLinkedListNode<T>::setNext(T* next) {
+ static_cast<T*>(this)->m_next = next;
}
-template<typename T> inline T* DoublyLinkedListNode<T>::prev() const
-{
- return static_cast<const T*>(this)->m_prev;
+template <typename T>
+inline T* DoublyLinkedListNode<T>::prev() const {
+ return static_cast<const T*>(this)->m_prev;
}
-template<typename T> inline T* DoublyLinkedListNode<T>::next() const
-{
- return static_cast<const T*>(this)->m_next;
+template <typename T>
+inline T* DoublyLinkedListNode<T>::next() const {
+ return static_cast<const T*>(this)->m_next;
}
-template<typename T> class DoublyLinkedList {
- USING_FAST_MALLOC(DoublyLinkedList);
-public:
- DoublyLinkedList();
+template <typename T>
+class DoublyLinkedList {
+ USING_FAST_MALLOC(DoublyLinkedList);
- bool isEmpty() const;
- size_t size() const; // This is O(n).
- void clear();
+ public:
+ DoublyLinkedList();
- T* head() const;
- T* removeHead();
+ bool isEmpty() const;
+ size_t size() const; // This is O(n).
+ void clear();
- T* tail() const;
+ T* head() const;
+ T* removeHead();
- void push(T*);
- void append(T*);
- void remove(T*);
+ T* tail() const;
-private:
- T* m_head;
- T* m_tail;
+ void push(T*);
+ void append(T*);
+ void remove(T*);
+
+ private:
+ T* m_head;
+ T* m_tail;
};
-template<typename T> inline DoublyLinkedList<T>::DoublyLinkedList()
- : m_head(0)
- , m_tail(0)
-{
-}
+template <typename T>
+inline DoublyLinkedList<T>::DoublyLinkedList() : m_head(0), m_tail(0) {}
-template<typename T> inline bool DoublyLinkedList<T>::isEmpty() const
-{
- return !m_head;
+template <typename T>
+inline bool DoublyLinkedList<T>::isEmpty() const {
+ return !m_head;
}
-template<typename T> inline size_t DoublyLinkedList<T>::size() const
-{
- size_t size = 0;
- for (T* node = m_head; node; node = node->next())
- ++size;
- return size;
+template <typename T>
+inline size_t DoublyLinkedList<T>::size() const {
+ size_t size = 0;
+ for (T* node = m_head; node; node = node->next())
+ ++size;
+ return size;
}
-template<typename T> inline void DoublyLinkedList<T>::clear()
-{
- m_head = 0;
- m_tail = 0;
+template <typename T>
+inline void DoublyLinkedList<T>::clear() {
+ m_head = 0;
+ m_tail = 0;
}
-template<typename T> inline T* DoublyLinkedList<T>::head() const
-{
- return m_head;
+template <typename T>
+inline T* DoublyLinkedList<T>::head() const {
+ return m_head;
}
-template<typename T> inline T* DoublyLinkedList<T>::tail() const
-{
- return m_tail;
+template <typename T>
+inline T* DoublyLinkedList<T>::tail() const {
+ return m_tail;
}
-template<typename T> inline void DoublyLinkedList<T>::push(T* node)
-{
- if (!m_head) {
- ASSERT(!m_tail);
- m_head = node;
- m_tail = node;
- node->setPrev(0);
- node->setNext(0);
- return;
- }
-
- ASSERT(m_tail);
- m_head->setPrev(node);
- node->setNext(m_head);
- node->setPrev(0);
+template <typename T>
+inline void DoublyLinkedList<T>::push(T* node) {
+ if (!m_head) {
+ ASSERT(!m_tail);
m_head = node;
+ m_tail = node;
+ node->setPrev(0);
+ node->setNext(0);
+ return;
+ }
+
+ ASSERT(m_tail);
+ m_head->setPrev(node);
+ node->setNext(m_head);
+ node->setPrev(0);
+ m_head = node;
}
-template<typename T> inline void DoublyLinkedList<T>::append(T* node)
-{
- if (!m_tail) {
- ASSERT(!m_head);
- m_head = node;
- m_tail = node;
- node->setPrev(0);
- node->setNext(0);
- return;
- }
-
- ASSERT(m_head);
- m_tail->setNext(node);
- node->setPrev(m_tail);
- node->setNext(0);
+template <typename T>
+inline void DoublyLinkedList<T>::append(T* node) {
+ if (!m_tail) {
+ ASSERT(!m_head);
+ m_head = node;
m_tail = node;
+ node->setPrev(0);
+ node->setNext(0);
+ return;
+ }
+
+ ASSERT(m_head);
+ m_tail->setNext(node);
+ node->setPrev(m_tail);
+ node->setNext(0);
+ m_tail = node;
}
-template<typename T> inline void DoublyLinkedList<T>::remove(T* node)
-{
- if (node->prev()) {
- ASSERT(node != m_head);
- node->prev()->setNext(node->next());
- } else {
- ASSERT(node == m_head);
- m_head = node->next();
- }
-
- if (node->next()) {
- ASSERT(node != m_tail);
- node->next()->setPrev(node->prev());
- } else {
- ASSERT(node == m_tail);
- m_tail = node->prev();
- }
+template <typename T>
+inline void DoublyLinkedList<T>::remove(T* node) {
+ if (node->prev()) {
+ ASSERT(node != m_head);
+ node->prev()->setNext(node->next());
+ } else {
+ ASSERT(node == m_head);
+ m_head = node->next();
+ }
+
+ if (node->next()) {
+ ASSERT(node != m_tail);
+ node->next()->setPrev(node->prev());
+ } else {
+ ASSERT(node == m_tail);
+ m_tail = node->prev();
+ }
}
-template<typename T> inline T* DoublyLinkedList<T>::removeHead()
-{
- T* node = head();
- if (node)
- remove(node);
- return node;
+template <typename T>
+inline T* DoublyLinkedList<T>::removeHead() {
+ T* node = head();
+ if (node)
+ remove(node);
+ return node;
}
-} // namespace WTF
+} // namespace WTF
using WTF::DoublyLinkedListNode;
using WTF::DoublyLinkedList;
« no previous file with comments | « third_party/WebKit/Source/wtf/DequeTest.cpp ('k') | third_party/WebKit/Source/wtf/DynamicAnnotations.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698