Speed up of LLViewerObjectList::cleanDeadObjects with a factor of 10000.

Also a little review of Dead objects in general.
The old code was calling 'erase' on a large vector, once for
every dead object (which are a lot, especially if you exit or
teleport), causing the whole (large) vector to be copied every
time. The new code only calls erase once per call (about once
a second at most now), erasing 20 to 100 objects at the END
of the vector. This is INCREDIBLY faster.
This commit is contained in:
Aleric Inglewood
2011-05-15 23:02:44 +02:00
parent 4e68f5878a
commit 93fdc2c89e
3 changed files with 71 additions and 32 deletions

View File

@@ -376,6 +376,12 @@ std::vector<affected_object> LocalBitmap::getUsingObjects(bool seek_by_type, boo
iter != gObjectList.mObjects.end(); iter++ )
{
LLViewerObject* obj = *iter;
if (obj->isDead())
{
continue;
}
affected_object shell;
shell.object = obj;
shell.local_sculptmap = false;