Index: base/containers/linked_list.h |
diff --git a/base/containers/linked_list.h b/base/containers/linked_list.h |
index 25bbe762cb759b4eba6c67b00ec0206c3e6bec4f..10d2c445895a3fc1c2e5dc120e44f292544d85b0 100644 |
--- a/base/containers/linked_list.h |
+++ b/base/containers/linked_list.h |
@@ -5,6 +5,8 @@ |
#ifndef BASE_CONTAINERS_LINKED_LIST_H_ |
#define BASE_CONTAINERS_LINKED_LIST_H_ |
+#include "base/macros.h" |
+ |
// Simple LinkedList type. (See the Q&A section to understand how this |
// differs from std::list). |
// |
@@ -106,6 +108,8 @@ class LinkNode { |
void RemoveFromList() { |
this->previous_->next_ = this->next_; |
this->next_->previous_ = this->previous_; |
+ this->next_ = NULL; |
+ this->previous_ = NULL; |
tyoshino (SeeGerritForStatus)
2014/05/22 06:04:01
use 0 or NULL for both initializer list and here?
Adam Rice
2014/05/22 06:49:07
Okay, I changed the initialisers to use NULL for s
|
} |
LinkNode<T>* previous() const { |
@@ -128,6 +132,8 @@ class LinkNode { |
private: |
LinkNode<T>* previous_; |
LinkNode<T>* next_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(LinkNode); |
}; |
template <typename T> |
@@ -155,8 +161,12 @@ class LinkedList { |
return &root_; |
} |
+ bool empty() const { return head() == end(); } |
+ |
private: |
LinkNode<T> root_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(LinkedList); |
}; |
} // namespace base |