Bug 819791 - Part 6: Remove unnecessary TArray copies in dom/indexedDB. r=bent
authorJustin Lebar <justin.lebar@gmail.com>
Tue, 18 Dec 2012 20:16:06 -0500 (2012-12-19)
changeset 116482 269b0c198fdb028adf981e2b0d81bf2c9ca7c46f
parent 116481 160c727a336b0dd9b33183f46201488d92414716
child 116483 200efa29960e4db6a3c627c26c5dfae764261f4c
push id24052
push useremorley@mozilla.com
push dateWed, 19 Dec 2012 19:30:46 +0000 (2012-12-19)
treeherdermozilla-central@27a1c1839d42 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbent
bugs819791
milestone20.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 819791 - Part 6: Remove unnecessary TArray copies in dom/indexedDB. r=bent
dom/indexedDB/IDBIndex.cpp
dom/indexedDB/IDBObjectStore.cpp
--- a/dom/indexedDB/IDBIndex.cpp
+++ b/dom/indexedDB/IDBIndex.cpp
@@ -1663,17 +1663,17 @@ GetAllHelper::UnpackResponseFromParentPr
   const InfallibleTArray<SerializedStructuredCloneReadInfo>& cloneInfos =
     getAllResponse.cloneInfos();
   const InfallibleTArray<BlobArray>& blobArrays = getAllResponse.blobs();
 
   mCloneReadInfos.SetCapacity(cloneInfos.Length());
 
   for (uint32_t index = 0; index < cloneInfos.Length(); index++) {
     const SerializedStructuredCloneReadInfo srcInfo = cloneInfos[index];
-    const InfallibleTArray<PBlobChild*> blobs = blobArrays[index].blobsChild();
+    const InfallibleTArray<PBlobChild*>& blobs = blobArrays[index].blobsChild();
 
     StructuredCloneReadInfo* destInfo = mCloneReadInfos.AppendElement();
     if (!destInfo->SetFromSerialized(srcInfo)) {
       NS_WARNING("Failed to copy clone buffer!");
       return NS_ERROR_DOM_INDEXEDDB_UNKNOWN_ERR;
     }
 
     IDBObjectStore::ConvertActorsToBlobs(blobs, destInfo->mFiles);
--- a/dom/indexedDB/IDBObjectStore.cpp
+++ b/dom/indexedDB/IDBObjectStore.cpp
@@ -3902,17 +3902,17 @@ GetAllHelper::UnpackResponseFromParentPr
   const InfallibleTArray<SerializedStructuredCloneReadInfo>& cloneInfos =
     getAllResponse.cloneInfos();
   const InfallibleTArray<BlobArray>& blobArrays = getAllResponse.blobs();
 
   mCloneReadInfos.SetCapacity(cloneInfos.Length());
 
   for (uint32_t index = 0; index < cloneInfos.Length(); index++) {
     const SerializedStructuredCloneReadInfo srcInfo = cloneInfos[index];
-    const InfallibleTArray<PBlobChild*> blobs = blobArrays[index].blobsChild();
+    const InfallibleTArray<PBlobChild*>& blobs = blobArrays[index].blobsChild();
 
     StructuredCloneReadInfo* destInfo = mCloneReadInfos.AppendElement();
     if (!destInfo->SetFromSerialized(srcInfo)) {
       NS_WARNING("Failed to copy clone buffer!");
       return NS_ERROR_DOM_INDEXEDDB_UNKNOWN_ERR;
     }
 
     IDBObjectStore::ConvertActorsToBlobs(blobs, destInfo->mFiles);