Skip to content
Snippets Groups Projects
Commit 270fe6e3 authored by Rye Mutt's avatar Rye Mutt :bread:
Browse files

More small opts to LLSD behavior

parent 00de6936
No related branches found
No related tags found
No related merge requests found
...@@ -571,11 +571,9 @@ void LLInventoryModelBackgroundFetch::bulkFetch() ...@@ -571,11 +571,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 (const auto& item : mFetchQueue)
it != mFetchQueue.end();
++it)
{ {
const LLUUID & fetch_id = (*it).mUUID; const LLUUID & fetch_id = item.mUUID;
if (gInventory.isObjectDescendentOf(fetch_id, cat_id)) if (gInventory.isObjectDescendentOf(fetch_id, cat_id))
return false; return false;
} }
...@@ -664,12 +662,8 @@ void BGFolderHttpHandler::processData(LLSD & content, LLCore::HttpResponse * res ...@@ -664,12 +662,8 @@ void BGFolderHttpHandler::processData(LLSD & content, LLCore::HttpResponse * res
{ {
LLSD folders(content["folders"]); LLSD folders(content["folders"]);
for (LLSD::array_const_iterator folder_it = folders.beginArray(); for (const auto& folder_sd : folders.array())
folder_it != folders.endArray();
++folder_it)
{ {
LLSD folder_sd(*folder_it);
//LLUUID agent_id = folder_sd["agent_id"]; //LLUUID agent_id = folder_sd["agent_id"];
//if(agent_id != gAgent.getID()) //This should never happen. //if(agent_id != gAgent.getID()) //This should never happen.
...@@ -690,16 +684,12 @@ void BGFolderHttpHandler::processData(LLSD & content, LLCore::HttpResponse * res ...@@ -690,16 +684,12 @@ void BGFolderHttpHandler::processData(LLSD & content, LLCore::HttpResponse * res
LLSD items(folder_sd["items"]); 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 (const auto& item : items.array())
item_it != items.endArray();
++item_it)
{ {
const LLUUID lost_uuid(gInventory.findCategoryUUIDForType(LLFolderType::FT_LOST_AND_FOUND)); const LLUUID lost_uuid(gInventory.findCategoryUUIDForType(LLFolderType::FT_LOST_AND_FOUND));
if (lost_uuid.notNull()) if (lost_uuid.notNull())
{ {
LLSD item(*item_it);
titem->unpackMessage(item); titem->unpackMessage(item);
LLInventoryModel::update_list_t update; LLInventoryModel::update_list_t update;
...@@ -721,11 +711,8 @@ void BGFolderHttpHandler::processData(LLSD & content, LLCore::HttpResponse * res ...@@ -721,11 +711,8 @@ void BGFolderHttpHandler::processData(LLSD & content, LLCore::HttpResponse * res
} }
LLSD categories(folder_sd["categories"]); LLSD categories(folder_sd["categories"]);
for (LLSD::array_const_iterator category_it = categories.beginArray(); for (const auto& category : categories.array())
category_it != categories.endArray();
++category_it)
{ {
LLSD category(*category_it);
tcategory->fromLLSD(category); tcategory->fromLLSD(category);
const bool recursive(getIsRecursive(tcategory->getUUID())); const bool recursive(getIsRecursive(tcategory->getUUID()));
...@@ -741,11 +728,8 @@ void BGFolderHttpHandler::processData(LLSD & content, LLCore::HttpResponse * res ...@@ -741,11 +728,8 @@ void BGFolderHttpHandler::processData(LLSD & content, LLCore::HttpResponse * res
LLSD items(folder_sd["items"]); 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 (const auto& item : items.array())
item_it != items.endArray();
++item_it)
{ {
LLSD item(*item_it);
titem->unpackMessage(item); titem->unpackMessage(item);
gInventory.updateItem(titem); gInventory.updateItem(titem);
...@@ -765,13 +749,8 @@ void BGFolderHttpHandler::processData(LLSD & content, LLCore::HttpResponse * res ...@@ -765,13 +749,8 @@ void BGFolderHttpHandler::processData(LLSD & content, LLCore::HttpResponse * res
if (content.has("bad_folders")) if (content.has("bad_folders"))
{ {
LLSD bad_folders(content["bad_folders"]); LLSD bad_folders(content["bad_folders"]);
for (LLSD::array_const_iterator folder_it = bad_folders.beginArray(); for (const auto& folder_sd : bad_folders.array())
folder_it != bad_folders.endArray();
++folder_it)
{ {
// *TODO: Stop copying data [ed: this isn't copying data]
LLSD folder_sd(*folder_it);
// These folders failed on the dataserver. We probably don't want to retry them. // These folders failed on the dataserver. We probably don't want to retry them.
LL_WARNS(LOG_INV) << "Folder " << folder_sd["folder_id"].asString() LL_WARNS(LOG_INV) << "Folder " << folder_sd["folder_id"].asString()
<< "Error: " << folder_sd["error"].asString() << LL_ENDL; << "Error: " << folder_sd["error"].asString() << LL_ENDL;
...@@ -807,11 +786,8 @@ void BGFolderHttpHandler::processFailure(LLCore::HttpStatus status, LLCore::Http ...@@ -807,11 +786,8 @@ void BGFolderHttpHandler::processFailure(LLCore::HttpStatus status, LLCore::Http
if (false) if (false)
{ {
// timed out or curl failure // timed out or curl failure
for (LLSD::array_const_iterator folder_it = mRequestSD["folders"].beginArray(); for (const auto& folder_sd : mRequestSD["folders"].array())
folder_it != mRequestSD["folders"].endArray();
++folder_it)
{ {
LLSD folder_sd(*folder_it);
LLUUID folder_id(folder_sd["folder_id"].asUUID()); LLUUID folder_id(folder_sd["folder_id"].asUUID());
const BOOL recursive = getIsRecursive(folder_id); const BOOL recursive = getIsRecursive(folder_id);
fetcher->addRequestAtFront(folder_id, recursive, true); fetcher->addRequestAtFront(folder_id, recursive, true);
...@@ -844,11 +820,8 @@ void BGFolderHttpHandler::processFailure(const char * const reason, LLCore::Http ...@@ -844,11 +820,8 @@ void BGFolderHttpHandler::processFailure(const char * const reason, LLCore::Http
LLInventoryModelBackgroundFetch *fetcher = LLInventoryModelBackgroundFetch::getInstance(); LLInventoryModelBackgroundFetch *fetcher = LLInventoryModelBackgroundFetch::getInstance();
if (true) if (true)
{ {
for (LLSD::array_const_iterator folder_it = mRequestSD["folders"].beginArray(); for (const auto& folder_sd : mRequestSD["folders"].array())
folder_it != mRequestSD["folders"].endArray();
++folder_it)
{ {
LLSD folder_sd(*folder_it);
LLUUID folder_id(folder_sd["folder_id"].asUUID()); LLUUID folder_id(folder_sd["folder_id"].asUUID());
const BOOL recursive = getIsRecursive(folder_id); const BOOL recursive = getIsRecursive(folder_id);
fetcher->addRequestAtFront(folder_id, recursive, true); fetcher->addRequestAtFront(folder_id, recursive, true);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment