From 75c21993954f20bcfc1c0153b7a308d7acfbc7e2 Mon Sep 17 00:00:00 2001 From: Chris Danford Date: Mon, 14 Mar 2005 00:38:51 +0000 Subject: [PATCH] GetMetricsThatBeginWith: fix iterating past the end of the set --- stepmania/src/ThemeManager.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/stepmania/src/ThemeManager.cpp b/stepmania/src/ThemeManager.cpp index fc8894b80f..41be50087f 100644 --- a/stepmania/src/ThemeManager.cpp +++ b/stepmania/src/ThemeManager.cpp @@ -836,15 +836,12 @@ void ThemeManager::GetMetricsThatBeginWith( const CString &_sClassName, const CS continue; // Iterate over all metrics that match. - XAttrs::const_iterator j = cur->m_attrs.lower_bound( sValueName ); - if( j == cur->m_attrs.end() ) - continue; - for( ; true; j++ ) + for( XAttrs::const_iterator j = cur->m_attrs.lower_bound( sValueName ); j != cur->m_attrs.end(); j++ ) { const CString &sv = j->first; if( sv.Left(sValueName.size()) == sValueName ) vsValueNamesOut.insert( sv ); - else + else // we passed the last metric that matched sValueName break; } }