From 039c0466f9759d7b966d8faf60945b3924d017a8 Mon Sep 17 00:00:00 2001
From: "Mark Palange (Mani)" <palange@lindenlab.com>
Date: Thu, 2 Dec 2010 11:40:54 -0800
Subject: [PATCH] CHOP-240 Fix for incorrect use of std:multimap iterators.
 Rev. by Alain.

---
 indra/newview/llremoteparcelrequest.cpp | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/indra/newview/llremoteparcelrequest.cpp b/indra/newview/llremoteparcelrequest.cpp
index 10d4452ed25..0dff0875533 100644
--- a/indra/newview/llremoteparcelrequest.cpp
+++ b/indra/newview/llremoteparcelrequest.cpp
@@ -78,10 +78,11 @@ void LLRemoteParcelRequestResponder::error(U32 status, const std::string& reason
 void LLRemoteParcelInfoProcessor::addObserver(const LLUUID& parcel_id, LLRemoteParcelInfoObserver* observer)
 {
 	observer_multimap_t::iterator it;
+	observer_multimap_t::iterator start = mObservers.lower_bound(parcel_id);
 	observer_multimap_t::iterator end = mObservers.upper_bound(parcel_id);
 
 	// Check if the observer is already in observers list for this UUID
-	for(it = mObservers.find(parcel_id); it != end; ++it)
+	for(it = start; it != end; ++it)
 	{
 		if (it->second.get() == observer)
 		{
@@ -100,9 +101,10 @@ void LLRemoteParcelInfoProcessor::removeObserver(const LLUUID& parcel_id, LLRemo
 	}
 
 	observer_multimap_t::iterator it;
+	observer_multimap_t::iterator start = mObservers.lower_bound(parcel_id);
 	observer_multimap_t::iterator end = mObservers.upper_bound(parcel_id);
 
-	for(it = mObservers.find(parcel_id); it != end; ++it)
+	for(it = start; it != end; ++it)
 	{
 		if (it->second.get() == observer)
 		{
@@ -139,9 +141,10 @@ void LLRemoteParcelInfoProcessor::processParcelInfoReply(LLMessageSystem* msg, v
 	deadlist_t dead_iters;
 
 	observer_multimap_t::iterator oi;
+	observer_multimap_t::iterator start = observers.lower_bound(parcel_data.parcel_id);
 	observer_multimap_t::iterator end = observers.upper_bound(parcel_data.parcel_id);
 
-	for (oi = observers.find(parcel_data.parcel_id); oi != end; ++oi)
+	for (oi = start; oi != end; ++oi)
 	{
 		LLRemoteParcelInfoObserver * observer = oi->second.get();
 		if(observer)
-- 
GitLab