From 74a9280c698b4f88a46549923a2d717b82dd7ee2 Mon Sep 17 00:00:00 2001 From: Fawrsk <45524015+Fawrsk@users.noreply.github.com> Date: Tue, 3 Jan 2023 17:08:15 -0400 Subject: SL-18893 Clean up for loops in llappearance to use C++11 range based for loops (#38) --- indra/llappearance/llavatarappearancedefines.cpp | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'indra/llappearance/llavatarappearancedefines.cpp') diff --git a/indra/llappearance/llavatarappearancedefines.cpp b/indra/llappearance/llavatarappearancedefines.cpp index 2bcfd06c40..5ab3f92b31 100644 --- a/indra/llappearance/llavatarappearancedefines.cpp +++ b/indra/llappearance/llavatarappearancedefines.cpp @@ -183,18 +183,15 @@ LLAvatarAppearanceDictionary::~LLAvatarAppearanceDictionary() // map it to the baked texture. void LLAvatarAppearanceDictionary::createAssociations() { - for (BakedTextures::const_iterator iter = mBakedTextures.begin(); iter != mBakedTextures.end(); iter++) + for (const auto& baked_pair : mBakedTextures) { - const EBakedTextureIndex baked_index = (iter->first); - const BakedEntry *dict = (iter->second); + const EBakedTextureIndex baked_index = baked_pair.first; + const BakedEntry *dict = baked_pair.second; // For each texture that this baked texture index affects, associate those textures // with this baked texture index. - for (texture_vec_t::const_iterator local_texture_iter = dict->mLocalTextures.begin(); - local_texture_iter != dict->mLocalTextures.end(); - local_texture_iter++) + for (const auto local_texture_index : dict->mLocalTextures) { - const ETextureIndex local_texture_index = (ETextureIndex) *local_texture_iter; mTextures[local_texture_index]->mIsUsedByBakedTexture = true; mTextures[local_texture_index]->mBakedTextureIndex = baked_index; } -- cgit v1.2.3 From 7419037ef6e8a5497283278baa8582b264d3aefa Mon Sep 17 00:00:00 2001 From: Fawrsk Date: Tue, 10 Jan 2023 05:43:27 -0400 Subject: SL-18893 Fixes for pull requests #38, #41, and #42 (#46) Eliminate unnecessary copies, and remove uses of auto --- indra/llappearance/llavatarappearancedefines.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/llappearance/llavatarappearancedefines.cpp') diff --git a/indra/llappearance/llavatarappearancedefines.cpp b/indra/llappearance/llavatarappearancedefines.cpp index 5ab3f92b31..8759c387e8 100644 --- a/indra/llappearance/llavatarappearancedefines.cpp +++ b/indra/llappearance/llavatarappearancedefines.cpp @@ -183,14 +183,14 @@ LLAvatarAppearanceDictionary::~LLAvatarAppearanceDictionary() // map it to the baked texture. void LLAvatarAppearanceDictionary::createAssociations() { - for (const auto& baked_pair : mBakedTextures) + for (BakedTextures::value_type& baked_pair : mBakedTextures) { const EBakedTextureIndex baked_index = baked_pair.first; const BakedEntry *dict = baked_pair.second; // For each texture that this baked texture index affects, associate those textures // with this baked texture index. - for (const auto local_texture_index : dict->mLocalTextures) + for (const ETextureIndex local_texture_index : dict->mLocalTextures) { mTextures[local_texture_index]->mIsUsedByBakedTexture = true; mTextures[local_texture_index]->mBakedTextureIndex = baked_index; -- cgit v1.2.3