Utilize vector_replace_with_last

This commit is contained in:
Shyotl
2014-07-05 19:29:10 -05:00
parent e2fa94e2c3
commit 4697216c5e
7 changed files with 28 additions and 71 deletions

View File

@@ -72,21 +72,11 @@ LLCharacter::~LLCharacter()
delete param;
}
U32 i ;
U32 size = sInstances.size() ;
for(i = 0 ; i < size ; i++)
{
if(sInstances[i] == this)
{
break ;
}
}
bool erased = vector_replace_with_last(sInstances,this);
llassert_always(i < size) ;
llassert_always(erased) ;
llassert_always(sAllowInstancesChange) ;
sInstances[i] = sInstances[size - 1] ;
sInstances.pop_back() ;
}