Commit 40f92721 authored by Rye Mutt's avatar Rye Mutt 🍞
Browse files

Optimize inventory fetch somewhat

parent 54f024f2
...@@ -569,8 +569,9 @@ void LLInventoryModelBackgroundFetch::bulkFetch() ...@@ -569,8 +569,9 @@ void LLInventoryModelBackgroundFetch::bulkFetch()
bool LLInventoryModelBackgroundFetch::fetchQueueContainsNoDescendentsOf(const LLUUID & cat_id) const bool LLInventoryModelBackgroundFetch::fetchQueueContainsNoDescendentsOf(const LLUUID & cat_id) const
{ {
for (fetch_queue_t::const_iterator it = mFetchQueue.begin(); for (fetch_queue_t::const_iterator it = mFetchQueue.begin(),
it != mFetchQueue.end(); end = mFetchQueue.end();
it != end;
++it) ++it)
{ {
const LLUUID & fetch_id = (*it).mUUID; const LLUUID & fetch_id = (*it).mUUID;
...@@ -660,10 +661,11 @@ void BGFolderHttpHandler::processData(LLSD & content, LLCore::HttpResponse * res ...@@ -660,10 +661,11 @@ void BGFolderHttpHandler::processData(LLSD & content, LLCore::HttpResponse * res
// Instead, we assume success and attempt to extract information. // Instead, we assume success and attempt to extract information.
if (content.has("folders")) if (content.has("folders"))
{ {
LLSD folders(content["folders"]); const LLSD& folders = content["folders"];
for (LLSD::array_const_iterator folder_it = folders.beginArray(); for (LLSD::array_const_iterator folder_it = folders.beginArray(),
folder_it != folders.endArray(); folder_end = folders.endArray();
folder_it != folder_end;
++folder_it) ++folder_it)
{ {
LLSD folder_sd(*folder_it); LLSD folder_sd(*folder_it);
...@@ -685,11 +687,12 @@ void BGFolderHttpHandler::processData(LLSD & content, LLCore::HttpResponse * res ...@@ -685,11 +687,12 @@ void BGFolderHttpHandler::processData(LLSD & content, LLCore::HttpResponse * res
if (parent_id.isNull()) if (parent_id.isNull())
{ {
LLSD items(folder_sd["items"]); const LLSD& items = folder_sd["items"];
LLPointer<LLViewerInventoryItem> titem = new LLViewerInventoryItem; LLPointer<LLViewerInventoryItem> titem = new LLViewerInventoryItem;
for (LLSD::array_const_iterator item_it = items.beginArray(); for (LLSD::array_const_iterator item_it = items.beginArray(),
item_it != items.endArray(); item_end = items.endArray();
item_it != item_end;
++item_it) ++item_it)
{ {
const LLUUID lost_uuid(gInventory.findCategoryUUIDForType(LLFolderType::FT_LOST_AND_FOUND)); const LLUUID lost_uuid(gInventory.findCategoryUUIDForType(LLFolderType::FT_LOST_AND_FOUND));
...@@ -718,9 +721,10 @@ void BGFolderHttpHandler::processData(LLSD & content, LLCore::HttpResponse * res ...@@ -718,9 +721,10 @@ void BGFolderHttpHandler::processData(LLSD & content, LLCore::HttpResponse * res
continue; continue;
} }
LLSD categories(folder_sd["categories"]); const LLSD& categories = folder_sd["categories"];
for (LLSD::array_const_iterator category_it = categories.beginArray(); for (LLSD::array_const_iterator category_it = categories.beginArray(),
category_it != categories.endArray(); category_end = categories.endArray();
category_it != category_end;
++category_it) ++category_it)
{ {
LLSD category(*category_it); LLSD category(*category_it);
...@@ -737,10 +741,11 @@ void BGFolderHttpHandler::processData(LLSD & content, LLCore::HttpResponse * res ...@@ -737,10 +741,11 @@ void BGFolderHttpHandler::processData(LLSD & content, LLCore::HttpResponse * res
} }
} }
LLSD items(folder_sd["items"]); const LLSD& items = folder_sd["items"];
LLPointer<LLViewerInventoryItem> titem = new LLViewerInventoryItem; LLPointer<LLViewerInventoryItem> titem = new LLViewerInventoryItem;
for (LLSD::array_const_iterator item_it = items.beginArray(); for (LLSD::array_const_iterator item_it = items.beginArray(),
item_it != items.endArray(); item_end = items.endArray();
item_it != item_end;
++item_it) ++item_it)
{ {
LLSD item(*item_it); LLSD item(*item_it);
...@@ -762,9 +767,10 @@ void BGFolderHttpHandler::processData(LLSD & content, LLCore::HttpResponse * res ...@@ -762,9 +767,10 @@ void BGFolderHttpHandler::processData(LLSD & content, LLCore::HttpResponse * res
if (content.has("bad_folders")) if (content.has("bad_folders"))
{ {
LLSD bad_folders(content["bad_folders"]); const LLSD& bad_folders = content["bad_folders"];
for (LLSD::array_const_iterator folder_it = bad_folders.beginArray(); for (LLSD::array_const_iterator folder_it = bad_folders.beginArray(),
folder_it != bad_folders.endArray(); folder_end = bad_folders.endArray();
folder_it != folder_end;
++folder_it) ++folder_it)
{ {
// *TODO: Stop copying data [ed: this isn't copying data] // *TODO: Stop copying data [ed: this isn't copying data]
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment