diff --git a/indra/newview/llinventorymodelbackgroundfetch.cpp b/indra/newview/llinventorymodelbackgroundfetch.cpp index 406c8b89d0b48d0667d1167d4a19339282eb630a..362fed2aa009b7d13e8b6b3b1214f57a82ae69f7 100644 --- a/indra/newview/llinventorymodelbackgroundfetch.cpp +++ b/indra/newview/llinventorymodelbackgroundfetch.cpp @@ -571,11 +571,9 @@ void LLInventoryModelBackgroundFetch::bulkFetch() bool LLInventoryModelBackgroundFetch::fetchQueueContainsNoDescendentsOf(const LLUUID & cat_id) const { - for (fetch_queue_t::const_iterator it = mFetchQueue.begin(); - it != mFetchQueue.end(); - ++it) + for (const auto& item : mFetchQueue) { - const LLUUID & fetch_id = (*it).mUUID; + const LLUUID & fetch_id = item.mUUID; if (gInventory.isObjectDescendentOf(fetch_id, cat_id)) return false; } @@ -664,12 +662,8 @@ void BGFolderHttpHandler::processData(LLSD & content, LLCore::HttpResponse * res { LLSD folders(content["folders"]); - for (LLSD::array_const_iterator folder_it = folders.beginArray(); - folder_it != folders.endArray(); - ++folder_it) + for (const auto& folder_sd : folders.array()) { - LLSD folder_sd(*folder_it); - //LLUUID agent_id = folder_sd["agent_id"]; //if(agent_id != gAgent.getID()) //This should never happen. @@ -690,16 +684,12 @@ void BGFolderHttpHandler::processData(LLSD & content, LLCore::HttpResponse * res LLSD items(folder_sd["items"]); LLPointer<LLViewerInventoryItem> titem = new LLViewerInventoryItem; - for (LLSD::array_const_iterator item_it = items.beginArray(); - item_it != items.endArray(); - ++item_it) + for (const auto& item : items.array()) { const LLUUID lost_uuid(gInventory.findCategoryUUIDForType(LLFolderType::FT_LOST_AND_FOUND)); if (lost_uuid.notNull()) { - LLSD item(*item_it); - titem->unpackMessage(item); LLInventoryModel::update_list_t update; @@ -721,11 +711,8 @@ void BGFolderHttpHandler::processData(LLSD & content, LLCore::HttpResponse * res } LLSD categories(folder_sd["categories"]); - for (LLSD::array_const_iterator category_it = categories.beginArray(); - category_it != categories.endArray(); - ++category_it) + for (const auto& category : categories.array()) { - LLSD category(*category_it); tcategory->fromLLSD(category); const bool recursive(getIsRecursive(tcategory->getUUID())); @@ -741,11 +728,8 @@ void BGFolderHttpHandler::processData(LLSD & content, LLCore::HttpResponse * res LLSD items(folder_sd["items"]); LLPointer<LLViewerInventoryItem> titem = new LLViewerInventoryItem; - for (LLSD::array_const_iterator item_it = items.beginArray(); - item_it != items.endArray(); - ++item_it) + for (const auto& item : items.array()) { - LLSD item(*item_it); titem->unpackMessage(item); gInventory.updateItem(titem); @@ -765,13 +749,8 @@ void BGFolderHttpHandler::processData(LLSD & content, LLCore::HttpResponse * res if (content.has("bad_folders")) { LLSD bad_folders(content["bad_folders"]); - for (LLSD::array_const_iterator folder_it = bad_folders.beginArray(); - folder_it != bad_folders.endArray(); - ++folder_it) + for (const auto& folder_sd : bad_folders.array()) { - // *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. LL_WARNS(LOG_INV) << "Folder " << folder_sd["folder_id"].asString() << "Error: " << folder_sd["error"].asString() << LL_ENDL; @@ -807,11 +786,8 @@ void BGFolderHttpHandler::processFailure(LLCore::HttpStatus status, LLCore::Http if (false) { // timed out or curl failure - for (LLSD::array_const_iterator folder_it = mRequestSD["folders"].beginArray(); - folder_it != mRequestSD["folders"].endArray(); - ++folder_it) + for (const auto& folder_sd : mRequestSD["folders"].array()) { - LLSD folder_sd(*folder_it); LLUUID folder_id(folder_sd["folder_id"].asUUID()); const BOOL recursive = getIsRecursive(folder_id); fetcher->addRequestAtFront(folder_id, recursive, true); @@ -844,11 +820,8 @@ void BGFolderHttpHandler::processFailure(const char * const reason, LLCore::Http LLInventoryModelBackgroundFetch *fetcher = LLInventoryModelBackgroundFetch::getInstance(); if (true) { - for (LLSD::array_const_iterator folder_it = mRequestSD["folders"].beginArray(); - folder_it != mRequestSD["folders"].endArray(); - ++folder_it) + for (const auto& folder_sd : mRequestSD["folders"].array()) { - LLSD folder_sd(*folder_it); LLUUID folder_id(folder_sd["folder_id"].asUUID()); const BOOL recursive = getIsRecursive(folder_id); fetcher->addRequestAtFront(folder_id, recursive, true);