diff --git a/indra/llcommon/llstl.h b/indra/llcommon/llstl.h index 2e3d52733..5afd5dc61 100644 --- a/indra/llcommon/llstl.h +++ b/indra/llcommon/llstl.h @@ -239,7 +239,7 @@ inline typename T::mapped_type get_ptr_in_map(const T& inmap, typename T::key_ty // //Singu note: This has been generalized to support a broader range of sequence containers template -inline typename T::iterator vector_replace_with_last(T& invec, typename T::iterator& iter) +inline typename T::iterator vector_replace_with_last(T& invec, typename T::iterator iter) { typename T::iterator last = invec.end(); if (iter == invec.end()) diff --git a/indra/newview/lldrawpool.cpp b/indra/newview/lldrawpool.cpp index 3a936eaf8..7a6ca0e24 100644 --- a/indra/newview/lldrawpool.cpp +++ b/indra/newview/lldrawpool.cpp @@ -301,8 +301,7 @@ void LLFacePool::removeFaceReference(LLFace *facep) if (idx != -1) { facep->setReferenceIndex(-1); - std::vector::iterator face_it(mReferences.begin() + idx); - std::vector::iterator iter = vector_replace_with_last(mReferences, face_it); + std::vector::iterator iter = vector_replace_with_last(mReferences, mReferences.begin() + idx); if(iter != mReferences.end()) (*iter)->setReferenceIndex(idx); } diff --git a/indra/newview/llflexibleobject.cpp b/indra/newview/llflexibleobject.cpp index cf97d4e82..6d985d386 100644 --- a/indra/newview/llflexibleobject.cpp +++ b/indra/newview/llflexibleobject.cpp @@ -80,8 +80,7 @@ LLVolumeImplFlexible::LLVolumeImplFlexible(LLViewerObject* vo, LLFlexibleObjectD LLVolumeImplFlexible::~LLVolumeImplFlexible() { - std::vector::iterator flex_it(sInstanceList.begin() + mInstanceIndex); - std::vector::iterator iter = vector_replace_with_last(sInstanceList, flex_it); + std::vector::iterator iter = vector_replace_with_last(sInstanceList, sInstanceList.begin() + mInstanceIndex); if(iter != sInstanceList.end()) (*iter)->mInstanceIndex = mInstanceIndex; std::vector::iterator update_it(sUpdateDelay.begin() + mInstanceIndex); diff --git a/indra/newview/llviewerobjectlist.cpp b/indra/newview/llviewerobjectlist.cpp index a97bc60aa..8cbd3c955 100644 --- a/indra/newview/llviewerobjectlist.cpp +++ b/indra/newview/llviewerobjectlist.cpp @@ -1459,8 +1459,7 @@ void LLViewerObjectList::removeFromActiveList(LLViewerObject* objectp) objectp->setListIndex(-1); - std::vector >::iterator it(mActiveObjects.begin() + idx); - std::vector >::iterator iter = vector_replace_with_last(mActiveObjects, it); + std::vector >::iterator iter = vector_replace_with_last(mActiveObjects, mActiveObjects.begin() + idx); if(iter != mActiveObjects.end()) (*iter)->setListIndex(idx); diff --git a/indra/newview/llviewerpartsim.cpp b/indra/newview/llviewerpartsim.cpp index c3f49f69f..3c0c37b3e 100644 --- a/indra/newview/llviewerpartsim.cpp +++ b/indra/newview/llviewerpartsim.cpp @@ -406,8 +406,7 @@ void LLViewerPartGroup::updateParticles(const F32 lastdt) // Kill dead particles (either flagged dead, or too old) if ((part->mLastUpdateTime > part->mMaxAge) || (LLViewerPart::LL_PART_DEAD_MASK == part->mFlags)) { - part_list_t::iterator it(mParticles.begin() + i); - vector_replace_with_last(mParticles, it); + vector_replace_with_last(mParticles, mParticles.begin() + i); delete part ; } else @@ -417,8 +416,7 @@ void LLViewerPartGroup::updateParticles(const F32 lastdt) { // Transfer particles between groups LLViewerPartSim::getInstance()->put(part) ; - part_list_t::iterator it(mParticles.begin() + i); - vector_replace_with_last(mParticles, it); + vector_replace_with_last(mParticles, mParticles.begin() + i); } else { @@ -723,8 +721,7 @@ void LLViewerPartSim::updateSimulation() if (mViewerPartSources[i]->isDead()) { - source_list_t::iterator it(mViewerPartSources.begin() + i); - vector_replace_with_last(mViewerPartSources, it); + vector_replace_with_last(mViewerPartSources, mViewerPartSources.begin() + i); //mViewerPartSources.erase(it); count--; } @@ -761,8 +758,7 @@ void LLViewerPartSim::updateSimulation() if (!mViewerPartGroups[i]->getCount()) { delete mViewerPartGroups[i]; - group_list_t::iterator it(mViewerPartGroups.begin() + i); - vector_replace_with_last(mViewerPartGroups, it); + vector_replace_with_last(mViewerPartGroups, mViewerPartGroups.begin() + i); //mViewerPartGroups.erase(it); i--; count--; diff --git a/indra/newview/llviewertextureanim.cpp b/indra/newview/llviewertextureanim.cpp index 1e6b7a343..525de0ed2 100644 --- a/indra/newview/llviewertextureanim.cpp +++ b/indra/newview/llviewertextureanim.cpp @@ -49,8 +49,7 @@ LLViewerTextureAnim::LLViewerTextureAnim(LLVOVolume* vobj) : LLTextureAnim() LLViewerTextureAnim::~LLViewerTextureAnim() { - std::vector::iterator it(sInstanceList.begin() + mInstanceIndex); - std::vector::iterator iter = vector_replace_with_last(sInstanceList, it); + std::vector::iterator iter = vector_replace_with_last(sInstanceList, sInstanceList.begin() + mInstanceIndex); if(iter != sInstanceList.end()) (*iter)->mInstanceIndex = mInstanceIndex; }