From 178f09f4d4f57a092c8b896aaab1d6b419f1ba2d Mon Sep 17 00:00:00 2001 From: Ansariel Date: Mon, 20 Nov 2023 13:02:54 +0100 Subject: [PATCH] This is actually fine: Iterator gets updated with the location of the next element following the erased element --- indra/newview/pipeline.cpp | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 7f52b8bb8b..75ab7ab2f2 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -1943,8 +1943,6 @@ void LLPipeline::updateMoveNormalAsync(LLDrawable* drawablep) void LLPipeline::updateMovedList(LLDrawable::drawable_vector_t& moved_list) { LL_PROFILE_ZONE_SCOPED; - LLDrawable::drawable_vector_t newList; // removing elements in the middle of a vector is a really bad idea. I'll just create a new one and swap it at the end. - for (LLDrawable::drawable_vector_t::iterator iter = moved_list.begin(); iter != moved_list.end(); ) { @@ -1973,15 +1971,9 @@ void LLPipeline::updateMovedList(LLDrawable::drawable_vector_t& moved_list) drawablep->getVObj()->dirtySpatialGroup(); } } - // removing elements in the middle of a vector is a really bad idea. I'll just create a new one and swap it at the end. - // iter = moved_list.erase(curiter); // removing elements in the middle of a vector is a really bad idea. I'll just create a new one and swap it at the end. + iter = moved_list.erase(curiter); } - else - newList.push_back( drawablep ); - // } - - moved_list.swap( newList ); // removing elements in the middle of a vector is a really bad idea. I'll just create a new one and swap it at the end. } void LLPipeline::updateMove()