Minor cleanup. Octree vfunc reduction. Range-based for loops with map/array llsd types.

This commit is contained in:
Shyotl
2020-02-25 01:50:50 -06:00
parent e0efbd7d26
commit 5c2c2a8c01
37 changed files with 218 additions and 296 deletions

View File

@@ -420,9 +420,8 @@ void LLMaterialMgr::onGetResponse(bool success, const LLSD& content, const LLUUI
llassert(response_data.isArray());
LL_DEBUGS("Materials") << "response has "<< response_data.size() << " materials" << LL_ENDL;
for (LLSD::array_const_iterator itMaterial = response_data.beginArray(); itMaterial != response_data.endArray(); ++itMaterial)
for (auto const& material_data : response_data.array())
{
const LLSD& material_data = *itMaterial;
llassert(material_data.isMap());
llassert(material_data.has(MATERIALS_CAP_OBJECT_ID_FIELD));
@@ -465,9 +464,8 @@ void LLMaterialMgr::onGetAllResponse(bool success, const LLSD& content, const LL
llassert(response_data.isArray());
LL_DEBUGS("Materials") << "response has "<< response_data.size() << " materials" << LL_ENDL;
for (LLSD::array_const_iterator itMaterial = response_data.beginArray(); itMaterial != response_data.endArray(); ++itMaterial)
for (auto const& material_data : response_data.array())
{
const LLSD& material_data = *itMaterial;
llassert(material_data.isMap());
llassert(material_data.has(MATERIALS_CAP_OBJECT_ID_FIELD));
@@ -531,11 +529,9 @@ void LLMaterialMgr::onPutResponse(bool success, const LLSD& content)
{
llassert(response_data.isArray());
LL_DEBUGS("Materials") << "response has "<< response_data.size() << " materials" << LL_ENDL;
for (LLSD::array_const_iterator faceIter = response_data.beginArray(); faceIter != response_data.endArray(); ++faceIter)
#ifdef SHOW_ASSERT
for (auto const& face_data : response_data.array())
{
# ifndef LL_RELEASE_FOR_DOWNLOAD
const LLSD& face_data = *faceIter; // conditional to avoid unused variable warning
# endif
llassert(face_data.isMap());
llassert(face_data.has(MATERIALS_CAP_OBJECT_ID_FIELD));
@@ -552,6 +548,7 @@ void LLMaterialMgr::onPutResponse(bool success, const LLSD& content)
// *TODO: do we really still need to process this?
}
#endif
}
}