Bug 1475139 part 1 - Add move assignment operator to nsTHashtable. r=froydnj
authorRyan Hunt <rhunt@eqrion.net>
Mon, 24 Sep 2018 21:23:17 -0500
changeset 495727 ab436fa8add92c153513aa8eedb8ccd5658976c7
parent 495726 70f63648a0f6cf738d5555eb347986d7323ef16e
child 495728 766131a8c0a9a8361c313b45f28ae8262af3dd8a
push id9984
push userffxbld-merge
push dateMon, 15 Oct 2018 21:07:35 +0000
treeherdermozilla-beta@183d27ea8570 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfroydnj
bugs1475139
milestone64.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 1475139 part 1 - Add move assignment operator to nsTHashtable. r=froydnj Differential Revision: https://phabricator.services.mozilla.com/D6780
xpcom/ds/nsTHashtable.h
--- a/xpcom/ds/nsTHashtable.h
+++ b/xpcom/ds/nsTHashtable.h
@@ -93,16 +93,17 @@ public:
   {}
 
   /**
    * destructor, cleans up and deallocates
    */
   ~nsTHashtable();
 
   nsTHashtable(nsTHashtable<EntryType>&& aOther);
+  nsTHashtable<EntryType>& operator=(nsTHashtable<EntryType>&& aOther);
 
   /**
    * Return the generation number for the table. This increments whenever
    * the table data items are moved.
    */
   uint32_t GetGeneration() const { return mTable.Generation(); }
 
   /**
@@ -401,16 +402,24 @@ FixedSizeEntryMover(PLDHashTable*,
 
 template<class EntryType>
 nsTHashtable<EntryType>::nsTHashtable(nsTHashtable<EntryType>&& aOther)
   : mTable(std::move(aOther.mTable))
 {
 }
 
 template<class EntryType>
+nsTHashtable<EntryType>&
+nsTHashtable<EntryType>::operator=(nsTHashtable<EntryType>&& aOther)
+{
+  mTable = std::move(aOther.mTable);
+  return *this;
+}
+
+template<class EntryType>
 nsTHashtable<EntryType>::~nsTHashtable()
 {
 }
 
 template<class EntryType>
 /* static */ const PLDHashTableOps*
 nsTHashtable<EntryType>::Ops()
 {