Bug 1452601 - Drop LayersId::EqualFn as it is unnecessary. r=botond
authorKartikaya Gupta <kgupta@mozilla.com>
Mon, 09 Apr 2018 08:29:55 -0400
changeset 412421 c55a88eebf534111b3c6401a66ff0ebf8fc56685
parent 412420 1e4c7821c157899ffc45055c457d31db36c255de
child 412422 bcacd467f8671ceebc903dc8018256e178393f58
push id33803
push userapavel@mozilla.com
push dateMon, 09 Apr 2018 21:54:49 +0000
treeherdermozilla-central@bbaa0e5f393c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
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 1452601 - Drop LayersId::EqualFn as it is unnecessary. r=botond It's not needed, because by default std::unorderd_map will use std::equal_to which delegates to the operator== on LayersId which does the same thing. We don't need to reimplement it. MozReview-Commit-ID: CLJO2JJfbF4
--- a/gfx/layers/LayersTypes.h
+++ b/gfx/layers/LayersTypes.h
@@ -72,31 +72,25 @@ struct LayersId {
     return mId == aOther.mId;
   bool operator!=(const LayersId& aOther) const
     return !(*this == aOther);
-  // Helper operators that allow this class to be used as a key in
+  // Helper struct that allow this class to be used as a key in
   // std::unordered_map like so:
-  //   std::unordered_map<LayersId, ValueType, LayersId::HashFn, LayersId::EqualFn> myMap;
+  //   std::unordered_map<LayersId, ValueType, LayersId::HashFn> myMap;
   struct HashFn {
     std::size_t operator()(const LayersId& aKey) const
       return std::hash<uint64_t>{}(aKey.mId);
-  struct EqualFn {
-    bool operator()(const LayersId& lhs, const LayersId& rhs) const
-    {
-      return lhs.mId == rhs.mId;
-    }
-  };
 enum class LayersBackend : int8_t {
--- a/gfx/layers/apz/src/APZCTreeManager.h
+++ b/gfx/layers/apz/src/APZCTreeManager.h
@@ -774,18 +774,17 @@ private:
   class CheckerboardFlushObserver;
   friend class CheckerboardFlushObserver;
   RefPtr<CheckerboardFlushObserver> mFlushObserver;
   // Map from layers id to APZTestData. Accesses and mutations must be
   // protected by the mTestDataLock.
-                     LayersId::HashFn,
-                     LayersId::EqualFn> mTestData;
+                     LayersId::HashFn> mTestData;
   mutable mozilla::Mutex mTestDataLock;
   // This must only be touched on the controller thread.
   float mDPI;
 #if defined(MOZ_WIDGET_ANDROID)
   AndroidDynamicToolbarAnimator* GetAndroidDynamicToolbarAnimator();
--- a/gfx/layers/apz/src/FocusState.h
+++ b/gfx/layers/apz/src/FocusState.h
@@ -139,18 +139,17 @@ private:
   // All methods should hold this lock, since this class is accessed via both
   // the updater and controller threads.
   mutable Mutex mMutex;
   // The set of focus targets received indexed by their layer tree ID
-                     LayersId::HashFn,
-                     LayersId::EqualFn> mFocusTree;
+                     LayersId::HashFn> mFocusTree;
   // The focus sequence number of the last potentially focus changing event
   // processed by APZ. This number starts at one and increases monotonically.
   // We don't worry about wrap around here because at a pace of 100 increments/sec,
   // it would take 5.85*10^9 years before we would wrap around. This number will
   // never be zero as that is used to catch uninitialized focus sequence numbers
   // on input events.
   uint64_t mLastAPZProcessedEvent;