Index: src/crashrpt/StackTrace.cpp
===================================================================
--- src/crashrpt/StackTrace.cpp	(revision 6315)
+++ src/crashrpt/StackTrace.cpp	(working copy)
@@ -32,9 +32,10 @@
 
 static CSymbolEngine & GetSymbolEngine()
 {
+	DWORD CurrProcessId = GetCurrentProcessId();
 	TSymbolEngineMap::iterator	iter;
-	iter = g_cSymMap.find(GetCurrentProcessId());
-	if (iter == g_cSymMap.end()) {
+	iter = g_cSymMap.lower_bound(CurrProcessId);
+	if (iter == g_cSymMap.end() || iter->first != CurrProcessId) {
 		CSymbolEngine	cSym;
 	    HANDLE hProcess = GetCurrentProcess ( ) ;
         DWORD dwOpts = SymGetOptions ( ) ;
@@ -42,7 +43,8 @@
         // Turn on load lines.
         SymSetOptions ( dwOpts                |
 						SYMOPT_LOAD_LINES      ) ;
-        if ( FALSE == g_cSymMap[GetCurrentProcessId()].SymInitialize ( hProcess ,
+		iter = g_cSymMap.insert(iter, std::make_pair(CurrProcessId, CSymbolEngine()));
+		if ( FALSE == iter->second.SymInitialize ( hProcess ,
                                              NULL     ,
                                              TRUE     ) )
             {
@@ -54,7 +56,7 @@
 #endif
             }
       }
-	return g_cSymMap[GetCurrentProcessId()];
+	return iter->second;
 }
 
 static DWORD __stdcall GetModBase ( HANDLE hProcess , DWORD dwAddr )
Index: src/TortoiseProc/RevisionGraph.cpp
===================================================================
--- src/TortoiseProc/RevisionGraph.cpp	(revision 6315)
+++ src/TortoiseProc/RevisionGraph.cpp	(working copy)
@@ -827,17 +827,15 @@
 			if (reventry->url)
 			{
 				std::string surl(reventry->url);
-				std::map<std::string, view>::iterator findit = pathmap.find(surl);
-				view myview;
-				myview.count = 1;
-				myview.level = 0;
-				if (findit==pathmap.end())
-					pathmap[surl] = myview;
-				else
+				std::map<std::string, view>::iterator findit = pathmap.lower_bound(surl);
+				if (findit == pathmap.end() || findit->first != surl)
 				{
-					// that URL already is in the map, so just increase its count
-					findit->second.count++;
+					findit = pathmap.insert(findit, std::make_pair(surl, view()));
+					findit->second.count = 0;
+					findit->second.level = 0;
 				}
+				// that URL already is in the map, so just increase its count
+				findit->second.count++;
 			}
 		}
 
@@ -877,17 +875,13 @@
 			CRevisionEntry * reventry = (CRevisionEntry*)m_arEntryPtrs.GetAt(i);
 			if ((lev = pathmap.find(std::string(reventry->url))) != pathmap.end())
 			{
-				std::map<int, int>::iterator levelit = levelmap.find(lev->second.level);
-				if (levelit!=levelmap.end())
+				std::map<int, int>::iterator levelit = levelmap.lower_bound(lev->second.level);
+				if (levelit == levelmap.end() || levelit->first != lev->second.level)
 				{
-					reventry->level = levelit->second;
-				}
-				else
-				{
-					reventry->level = reallevel;
-					levelmap[lev->second.level] = reallevel;
+					levelit = levelmap.insert(levelit, std::make_pair(lev->second.level, reallevel));
 					++reallevel;
 				}
+				reventry->level = levelit->second;
 			}
 			else
 				ATLASSERT(FALSE);
Index: src/TortoiseProc/StatGraphDlg.cpp
===================================================================
--- src/TortoiseProc/StatGraphDlg.cpp	(revision 6315)
+++ src/TortoiseProc/StatGraphDlg.cpp	(working copy)
@@ -248,12 +248,10 @@
 		if (m_bIgnoreAuthorCase)
 			sAuth = sAuth.MakeLower();
 		stdstring author = stdstring(sAuth);
-		if (authorcommits.find(author) != authorcommits.end())
-		{
-			authorcommits[author] += 1;
-		}
-		else
-			authorcommits[author] = 1;
+		std::map<stdstring, LONG>::iterator it = authorcommits.lower_bound(author);
+		if (it == authorcommits.end() || it->first != author)
+			it = authorcommits.insert(it, std::make_pair(author, 0));
+		it->second++;
 		nTotalCommits++;
 	}
 
@@ -323,12 +321,10 @@
 		if (m_bIgnoreAuthorCase)
 			sAuth = sAuth.MakeLower();
 		stdstring author = stdstring(sAuth);
-		if (author_commits.find(author) != author_commits.end())
-		{
-			author_commits[author] += 1;
-		}
-		else
-			author_commits[author] = 1;
+		std::map<stdstring, LONG>::iterator it = author_commits.lower_bound(author);
+		if (it == author_commits.end() || it->first != author)
+			it = author_commits.insert(it, std::make_pair(author, 0));
+		it->second++;
 		nTotalCommits++;
 	}
 
@@ -386,8 +382,9 @@
 			iter = authors.begin();
 			while (iter != authors.end())
 			{
-				if (authorcommits.find(iter->first) != authorcommits.end())
-					graphData->SetData(iter->second, authorcommits[iter->first]);
+				std::map<stdstring, LONG>::iterator ac_it = authorcommits.lower_bound(iter->first);
+				if (ac_it != authorcommits.end() && ac_it->first == iter->first)
+					graphData->SetData(iter->second, ac_it->second);
 				else
 					graphData->SetData(iter->second, 0);
 				iter++;
@@ -429,34 +426,23 @@
 		if (m_bIgnoreAuthorCase)
 			sAuth = sAuth.MakeLower();
 		stdstring author = stdstring(sAuth);
-		if (authorcommits.find(author) != authorcommits.end())
-		{
-			if (authors.find(author) != authors.end())
-				authorcommits[author] += 1;
-			else
-				authorcommits[stdstring((LPCTSTR)sOthers)] += 1;
-		}
-		else
-		{
-			if (authors.find(author) != authors.end())
-				authorcommits[author] = 1;
-			else if (authorcommits.find(stdstring((LPCTSTR)sOthers)) == authorcommits.end())
-				authorcommits[stdstring((LPCTSTR)sOthers)] = 1;
-			else
-				authorcommits[stdstring((LPCTSTR)sOthers)] += 1;
-		}
+		if (authors.find(author) == authors.end())
+			author = stdstring((LPCTSTR)sOthers);
+		std::map<stdstring, LONG>::iterator ac_it = authorcommits.lower_bound(author);
+		if (ac_it == authorcommits.end() || ac_it->first != author)
+			ac_it = authorcommits.insert(ac_it, std::make_pair(author, 0));
+		ac_it->second++;
 	}
 
 	MyGraphSeries * graphData = new MyGraphSeries();
 	iter = authors.begin();
 	while (iter != authors.end())
 	{
-		if (authorcommits.find(iter->first) != authorcommits.end())
-		{
-			graphData->SetData(iter->second, authorcommits[iter->first]);
-		}
-		else
-			graphData->SetData(iter->second, 0);
+		int val = 0;
+		std::map<stdstring, LONG>::const_iterator it = authorcommits.lower_bound(iter->first);
+		if (it != authorcommits.end() && it->first == iter->first)
+			val = it->second;
+		graphData->SetData(iter->second, val);
 		iter++;
 	}
 
@@ -492,9 +478,10 @@
 		if (m_bIgnoreAuthorCase)
 			sAuth = sAuth.MakeLower();
 		stdstring author = stdstring(sAuth);
-		if (authors.find(author) == authors.end())
+		std::map<stdstring, LONG>::iterator it = authors.lower_bound(author);
+		if (it == authors.end() || it->first != author)
 		{
-			authors[author] = m_graph.AppendGroup(author.c_str());
+			authors.insert(it, std::make_pair(author, m_graph.AppendGroup(author.c_str())));
 			numAuthors++;
 		}
 	}
@@ -520,35 +507,37 @@
 		if (m_bIgnoreAuthorCase)
 			sAuth = sAuth.MakeLower();
 		stdstring author = stdstring(sAuth);
-		if (authorcommits.find(author) != authorcommits.end())
-		{
-			authorcommits[author] += 1;
-		}
-		else
-		{
-			authorcommits[author] = 1;
-		}
+		std::map<stdstring, LONG>::iterator it = authorcommits.lower_bound(author);
+		if (it == authorcommits.end() || it->first != author)
+			it = authorcommits.insert(it, std::make_pair(author, 0));
+		it->second++;
 		if (nCurrentWeek != GetWeek(time))
 		{
 			std::map<stdstring, LONG>::iterator iter;
 			iter = authors.begin();
 			while (iter != authors.end())
 			{
-				if (AuthorCommits.find(iter->first) == AuthorCommits.end())
-					AuthorCommits[iter->first] = 0;
-				if (AuthorCommitsMin.find(iter->first) == AuthorCommitsMin.end())
-					AuthorCommitsMin[iter->first] = -1;
-				if (AuthorCommitsMax.find(iter->first) == AuthorCommitsMax.end())
-					AuthorCommitsMax[iter->first] = 0;
-				if (authorcommits.find(iter->first) == authorcommits.end())
-					authorcommits[iter->first] = 0;
+				std::map<stdstring, LONG>::iterator AC_it = AuthorCommits.lower_bound(iter->first);
+				if (AC_it == AuthorCommits.end() || AC_it->first != iter->first)
+					AC_it = AuthorCommits.insert(AC_it, std::make_pair(iter->first, 0));
 
-				long ac = authorcommits[iter->first];
-				AuthorCommits[iter->first] += ac;
-				if ((AuthorCommitsMin[iter->first] == -1)||(AuthorCommitsMin[iter->first] > ac))
-					AuthorCommitsMin[iter->first] = ac;
-				if (AuthorCommitsMax[iter->first] < ac)
-					AuthorCommitsMax[iter->first] = ac;
+				std::map<stdstring, LONG>::iterator ACMIN_it = AuthorCommitsMin.lower_bound(iter->first);
+				if (ACMIN_it == AuthorCommitsMin.end() || ACMIN_it->first != iter->first)
+					ACMIN_it = AuthorCommitsMin.insert(ACMIN_it, std::make_pair(iter->first, -1));
+
+				std::map<stdstring, LONG>::iterator ACMAX_it = AuthorCommitsMax.lower_bound(iter->first);
+				if (ACMAX_it == AuthorCommitsMax.end() || ACMAX_it->first != iter->first)
+					ACMAX_it = AuthorCommitsMax.insert(ACMAX_it, std::make_pair(iter->first, 0));
+
+				std::map<stdstring, LONG>::iterator ac_it = authorcommits.lower_bound(iter->first);
+				if (ac_it == authorcommits.end() || ac_it->first != iter->first)
+					ac_it = authorcommits.insert(ac_it, std::make_pair(iter->first, 0));
+
+				AC_it->second += ac_it->second;
+				if (ACMIN_it->second == -1 || ACMIN_it->second > ac_it->second)
+					ACMIN_it->second = ac_it->second;
+				if (ACMAX_it->second < ac_it->second)
+					ACMAX_it->second = ac_it->second;
 				iter++;
 			}
 			authorcommits.clear();
@@ -576,21 +565,28 @@
 		iter = authors.begin();
 		while (iter != authors.end())
 		{
-			if (AuthorCommits.find(iter->first) == AuthorCommits.end())
-				AuthorCommits[iter->first] = 0;
-			if (AuthorCommitsMin.find(iter->first) == AuthorCommitsMin.end())
-				AuthorCommitsMin[iter->first] = -1;
-			if (AuthorCommitsMax.find(iter->first) == AuthorCommitsMax.end())
-				AuthorCommitsMax[iter->first] = 0;
-			if (authorcommits.find(iter->first) == authorcommits.end())
-				authorcommits[iter->first] = 0;
 
-			long ac = authorcommits[iter->first];
-			AuthorCommits[iter->first] += ac;
-			if ((AuthorCommitsMin[iter->first] == -1)||(AuthorCommitsMin[iter->first] > ac))
-				AuthorCommitsMin[iter->first] = ac;
-			if (AuthorCommitsMax[iter->first] < ac)
-				AuthorCommitsMax[iter->first] = ac;
+			std::map<stdstring, LONG>::iterator AC_it = AuthorCommits.lower_bound(iter->first);
+			if (AC_it == AuthorCommits.end() || AC_it->first != iter->first)
+				AC_it = AuthorCommits.insert(AC_it, std::make_pair(iter->first, 0));
+
+			std::map<stdstring, LONG>::iterator ACMIN_it = AuthorCommitsMin.lower_bound(iter->first);
+			if (ACMIN_it == AuthorCommitsMin.end() || ACMIN_it->first != iter->first)
+				ACMIN_it = AuthorCommitsMin.insert(ACMIN_it, std::make_pair(iter->first, -1));
+
+			std::map<stdstring, LONG>::iterator ACMAX_it = AuthorCommitsMax.lower_bound(iter->first);
+			if (ACMAX_it == AuthorCommitsMax.end() || ACMAX_it->first != iter->first)
+				ACMAX_it = AuthorCommitsMax.insert(ACMAX_it, std::make_pair(iter->first, 0));
+
+			std::map<stdstring, LONG>::iterator ac_it = authorcommits.lower_bound(iter->first);
+			if (ac_it == authorcommits.end() || ac_it->first != iter->first)
+				ac_it = authorcommits.insert(ac_it, std::make_pair(iter->first, 0));
+
+			AC_it->second += ac_it->second;
+			if (ACMIN_it->second == -1 || ACMIN_it->second > ac_it->second)
+				ACMIN_it->second = ac_it->second;
+			if (ACMAX_it->second < ac_it->second)
+				ACMAX_it->second = ac_it->second;
 			iter++;
 		}
 		authorcommits.clear();
@@ -636,41 +632,46 @@
 	number.Format(_T("%ld"), nFileChangesMin);
 	GetDlgItem(IDC_FILECHANGESEACHWEEKMIN)->SetWindowText(number);
 
-	std::map<stdstring, LONG>::iterator iter;
-	iter = AuthorCommits.begin();
-	stdstring mostauthor;
-	stdstring leastauthor;
-
-	if (iter != AuthorCommits.end())
+	if (AuthorCommits.empty())
 	{
-		mostauthor = iter->first;
-		leastauthor = iter->first;
+		GetDlgItem(IDC_MOSTACTIVEAUTHORNAME)->SetWindowText(_T(""));
+		GetDlgItem(IDC_MOSTACTIVEAUTHORAVG)->SetWindowText(_T("0"));
+		GetDlgItem(IDC_MOSTACTIVEAUTHORMAX)->SetWindowText(_T("0"));
+		GetDlgItem(IDC_MOSTACTIVEAUTHORMIN)->SetWindowText(_T("0"));
+		GetDlgItem(IDC_LEASTACTIVEAUTHORNAME)->SetWindowText(_T(""));
+		GetDlgItem(IDC_LEASTACTIVEAUTHORAVG)->SetWindowText(_T("0"));
+		GetDlgItem(IDC_LEASTACTIVEAUTHORMAX)->SetWindowText(_T("0"));
+		GetDlgItem(IDC_LEASTACTIVEAUTHORMIN)->SetWindowText(_T("0"));
 	}
-	while (iter != AuthorCommits.end())
+	else // AuthorCommits isn't empty
 	{
-		if (AuthorCommits[mostauthor] < iter->second)
-			mostauthor = iter->first;
+		std::map<stdstring, LONG>::const_iterator iter, most_it, least_it;
+		iter = most_it = least_it = AuthorCommits.begin();
+		while (iter != AuthorCommits.end())
+		{
+			if (most_it->second < iter->second)
+				most_it = iter;
+			if (least_it->second > iter->second)
+				least_it = iter;
+			iter++;
+		}
+		// assuming AuthorCommitsMax and AuthorCommitsMin aren't empty too
+		GetDlgItem(IDC_MOSTACTIVEAUTHORNAME)->SetWindowText(most_it->first.c_str());
+		number.Format(_T("%ld"), most_it->second / nWeeks);
+		GetDlgItem(IDC_MOSTACTIVEAUTHORAVG)->SetWindowText(number);
+		number.Format(_T("%ld"), AuthorCommitsMax[most_it->first]);
+		GetDlgItem(IDC_MOSTACTIVEAUTHORMAX)->SetWindowText(number);
+		number.Format(_T("%ld"), AuthorCommitsMin[most_it->first]);
+		GetDlgItem(IDC_MOSTACTIVEAUTHORMIN)->SetWindowText(number);
 
-		if (AuthorCommits[leastauthor] > iter->second)
-			leastauthor = iter->first;
-
-		iter++;
+		GetDlgItem(IDC_LEASTACTIVEAUTHORNAME)->SetWindowText(least_it->first.c_str());
+		number.Format(_T("%ld"), least_it->second / nWeeks);
+		GetDlgItem(IDC_LEASTACTIVEAUTHORAVG)->SetWindowText(number);
+		number.Format(_T("%ld"), AuthorCommitsMax[least_it->first]);
+		GetDlgItem(IDC_LEASTACTIVEAUTHORMAX)->SetWindowText(number);
+		number.Format(_T("%ld"), AuthorCommitsMin[least_it->first]);
+		GetDlgItem(IDC_LEASTACTIVEAUTHORMIN)->SetWindowText(number);
 	}
-	GetDlgItem(IDC_MOSTACTIVEAUTHORNAME)->SetWindowText(mostauthor.c_str());
-	number.Format(_T("%ld"), AuthorCommits[mostauthor] / nWeeks);
-	GetDlgItem(IDC_MOSTACTIVEAUTHORAVG)->SetWindowText(number);
-	number.Format(_T("%ld"), AuthorCommitsMax[mostauthor]);
-	GetDlgItem(IDC_MOSTACTIVEAUTHORMAX)->SetWindowText(number);
-	number.Format(_T("%ld"), AuthorCommitsMin[mostauthor]);
-	GetDlgItem(IDC_MOSTACTIVEAUTHORMIN)->SetWindowText(number);
-
-	GetDlgItem(IDC_LEASTACTIVEAUTHORNAME)->SetWindowText(leastauthor.c_str());
-	number.Format(_T("%ld"), AuthorCommits[leastauthor] / nWeeks);
-	GetDlgItem(IDC_LEASTACTIVEAUTHORAVG)->SetWindowText(number);
-	number.Format(_T("%ld"), AuthorCommitsMax[leastauthor]);
-	GetDlgItem(IDC_LEASTACTIVEAUTHORMAX)->SetWindowText(number);
-	number.Format(_T("%ld"), AuthorCommitsMin[leastauthor]);
-	GetDlgItem(IDC_LEASTACTIVEAUTHORMIN)->SetWindowText(number);
 }
 
 void CStatGraphDlg::OnCbnSelchangeGraphcombo()
Index: src/TortoiseProc/SVNProgressDlg.cpp
===================================================================
--- src/TortoiseProc/SVNProgressDlg.cpp	(revision 6315)
+++ src/TortoiseProc/SVNProgressDlg.cpp	(working copy)
@@ -688,10 +688,10 @@
 							if (st.status->entry->uuid)
 							{
 								uuid = st.status->entry->uuid;
-								UuidMap::const_iterator iter;
-								if ((iter = uuidmap.find(uuid)) == uuidmap.end())
+								UuidMap::iterator iter = uuidmap.lower_bound(uuid);
+								if (iter == uuidmap.end() || iter->first != uuid)
 								{
-									uuidmap[uuid] = headrev;
+									uuidmap.insert(iter, std::make_pair(uuid, headrev));
 									nUUIDs++;
 								}
 								else
Index: src/TortoiseShell/SVNPropertyPage.cpp
===================================================================
--- src/TortoiseShell/SVNPropertyPage.cpp	(revision 6315)
+++ src/TortoiseShell/SVNPropertyPage.cpp	(working copy)
@@ -264,8 +264,9 @@
 						int sel = ListView_GetSelectionMark(lvh);
 						ListView_GetItemTextEx(lvh, sel, 0, buf);
 						SetDlgItemText(m_hwnd, IDC_EDITNAME, buf);
-						if (propmap.find(stdstring(buf)) != propmap.end())
-							SetDlgItemText(m_hwnd, IDC_EDITVALUE, propmap.find(stdstring(buf))->second.c_str());
+						std::map<stdstring, stdstring>::const_iterator it;
+						if ((it = propmap.find(stdstring(buf))) != propmap.end())
+							SetDlgItemText(m_hwnd, IDC_EDITVALUE, it->second.c_str());
 						delete [] buf;
 					} // if (count > 0) 
 					else
Index: src/TSVNCache/CachedDirectory.cpp
===================================================================
--- src/TSVNCache/CachedDirectory.cpp	(revision 6315)
+++ src/TSVNCache/CachedDirectory.cpp	(working copy)
@@ -716,7 +716,9 @@
 		{
 			CTSVNPath filePath(m_directoryPath);
 			filePath.AppendPathString(itMembers->first);
-			if ((!filePath.IsEquivalentTo(m_directoryPath))&&(refreshedpaths.find(filePath)==refreshedpaths.end()))
+			std::set<CTSVNPath>::iterator refr_it;
+			if ((!filePath.IsEquivalentTo(m_directoryPath))&&
+				((refr_it = refreshedpaths.lower_bound(filePath)) == refreshedpaths.end() || filePath != *reft_it))
 			{
 				if ((itMembers->second.HasExpired(now))||(!itMembers->second.DoesFileTimeMatch(filePath.GetLastWriteTime())))
 				{
@@ -726,7 +728,7 @@
 					// So start the loop again, but add this path to the refreshedpaths set
 					// to make sure we don't refresh this path again. This is to make sure
 					// that we don't end up in an endless loop.
-					refreshedpaths.insert(filePath);
+					refreshedpaths.insert(reft_it, filePath);
 					itMembers = m_entryCache.begin();
 					if (m_entryCache.size()==0)
 						return;
