Bug 1311277 Part 4 - Convert NodeKind to be an enum class. r=froydnj
authorTing-Yu Lin <tlin@mozilla.com>
Thu, 20 Oct 2016 17:01:11 +0800
changeset 364044 2626096d67040cd7a49fb5347147157c0965d5ed
parent 364043 d6bd5ef77aebdab96355e022bf6ff1fefbf20ddf
child 364045 7d608304562af28f6a824ab1e59a7f973b2760dd
push id1369
push userjlorenzo@mozilla.com
push dateMon, 27 Feb 2017 14:59:41 +0000
treeherdermozilla-release@d75a1dba431f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfroydnj
bugs1311277
milestone52.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1311277 Part 4 - Convert NodeKind to be an enum class. r=froydnj MozReview-Commit-ID: 2APdWxa8rZ6
mfbt/LinkedList.h
--- a/mfbt/LinkedList.h
+++ b/mfbt/LinkedList.h
@@ -217,25 +217,25 @@ public:
   {
     MOZ_ASSERT((mNext == this) == (mPrev == this));
     return mNext != this;
   }
 
 private:
   friend class LinkedList<T>;
 
-  enum NodeKind {
-    NODE_KIND_NORMAL,
-    NODE_KIND_SENTINEL
+  enum class NodeKind {
+    Normal,
+    Sentinel
   };
 
   explicit LinkedListElement(NodeKind nodeKind)
     : mNext(this),
       mPrev(this),
-      mIsSentinel(nodeKind == NODE_KIND_SENTINEL)
+      mIsSentinel(nodeKind == NodeKind::Sentinel)
   { }
 
   /*
    * Return |this| cast to T* if we're a normal node, or return nullptr if
    * we're a sentinel node.
    */
   T* asT()
   {
@@ -335,17 +335,17 @@ public:
       return *this;
     }
 
     bool operator!=(Iterator& aOther) const {
       return mCurrent != aOther.mCurrent;
     }
   };
 
-  LinkedList() : sentinel(LinkedListElement<T>::NODE_KIND_SENTINEL) { }
+  LinkedList() : sentinel(LinkedListElement<T>::NodeKind::Sentinel) { }
 
   LinkedList(LinkedList<T>&& aOther)
     : sentinel(mozilla::Move(aOther.sentinel))
   { }
 
   LinkedList& operator=(LinkedList<T>&& aOther)
   {
     MOZ_ASSERT(isEmpty(), "Assigning to a non-empty list leaks elements in that list!");