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

@@ -6547,12 +6547,7 @@ BOOL LLVOAvatar::detachObject(LLViewerObject *viewer_object)
if (attachment->isObjectAttached(viewer_object))
{
std::vector<std::pair<LLViewerObject*,LLViewerJointAttachment*> >::iterator it = std::find(mAttachedObjectsVector.begin(),mAttachedObjectsVector.end(),std::make_pair(viewer_object,attachment));
if(it != mAttachedObjectsVector.end())
{
(*it) = mAttachedObjectsVector.back();
mAttachedObjectsVector.pop_back();
}
vector_replace_with_last(mAttachedObjectsVector,std::make_pair(viewer_object,attachment));
cleanupAttachedMesh( viewer_object );
attachment->removeObject(viewer_object);