GetMetricsThatBeginWith: fix iterating past the end of the set

This commit is contained in:
Chris Danford
2005-03-14 00:38:51 +00:00
parent 755277cef5
commit 75c2199395
+2 -5
View File
@@ -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;
}
}