This is actually fine: Iterator gets updated with the location of the next element following the erased element
parent
bfa45e2311
commit
178f09f4d4
|
|
@ -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; // <FS:ND> 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();
|
||||
}
|
||||
}
|
||||
// <FS:ND> 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); // <FS:ND> 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 );
|
||||
// </FS:ND>
|
||||
}
|
||||
|
||||
moved_list.swap( newList ); // <FS:ND> 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()
|
||||
|
|
|
|||
Loading…
Reference in New Issue