diff --git a/indra/llcommon/llstl.h b/indra/llcommon/llstl.h index ec98bb911..2e3d52733 100644 --- a/indra/llcommon/llstl.h +++ b/indra/llcommon/llstl.h @@ -241,12 +241,12 @@ inline typename T::mapped_type get_ptr_in_map(const T& inmap, typename T::key_ty template inline typename T::iterator vector_replace_with_last(T& invec, typename T::iterator& iter) { - typename T::iterator last = invec.end(); --last; + typename T::iterator last = invec.end(); if (iter == invec.end()) { return iter; } - else if (iter == last) + else if (iter == --last) { invec.pop_back(); return invec.end();