Bug 815671 part 9. Fix hashtables to take a UserDataType reference on put, so that putting an array works. r=bsmedberg
authorBoris Zbarsky <bzbarsky@mit.edu>
Thu, 29 Nov 2012 11:14:14 -0500
changeset 114506 58340dfc22cb819ad0a723d2ea3a301e2fbd5947
parent 114505 ae518bf8df998b623b409caf7682237a0b494481
child 114507 3e1e34df0e83fd06abf98e7c44301fc840860ef5
push id2151
push userlsblakk@mozilla.com
push dateTue, 19 Feb 2013 18:06:57 +0000
treeherdermozilla-esr52@5bb309998e70 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbsmedberg
bugs815671
milestone20.0a1
Bug 815671 part 9. Fix hashtables to take a UserDataType reference on put, so that putting an array works. r=bsmedberg
xpcom/glue/nsBaseHashtable.h
--- a/xpcom/glue/nsBaseHashtable.h
+++ b/xpcom/glue/nsBaseHashtable.h
@@ -131,23 +131,23 @@ public:
   }
 
   /**
    * put a new value for the associated key
    * @param aKey the key to put
    * @param aData the new data
    * @return always true, unless memory allocation failed
    */
-  void Put(KeyType aKey, UserDataType aData)
+  void Put(KeyType aKey, const UserDataType& aData)
   {
     if (!Put(aKey, aData, fallible_t()))
       NS_RUNTIMEABORT("OOM");
   }
 
-  bool Put(KeyType aKey, UserDataType aData, const fallible_t&) NS_WARN_UNUSED_RESULT
+  bool Put(KeyType aKey, const UserDataType& aData, const fallible_t&) NS_WARN_UNUSED_RESULT
   {
     EntryType* ent = this->PutEntry(aKey);
 
     if (!ent)
       return false;
 
     ent->mData = aData;