GetMetricsThatBeginWith: fix iterating past the end of the set
This commit is contained in:
@@ -836,15 +836,12 @@ void ThemeManager::GetMetricsThatBeginWith( const CString &_sClassName, const CS
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
// Iterate over all metrics that match.
|
// Iterate over all metrics that match.
|
||||||
XAttrs::const_iterator j = cur->m_attrs.lower_bound( sValueName );
|
for( XAttrs::const_iterator j = cur->m_attrs.lower_bound( sValueName ); j != cur->m_attrs.end(); j++ )
|
||||||
if( j == cur->m_attrs.end() )
|
|
||||||
continue;
|
|
||||||
for( ; true; j++ )
|
|
||||||
{
|
{
|
||||||
const CString &sv = j->first;
|
const CString &sv = j->first;
|
||||||
if( sv.Left(sValueName.size()) == sValueName )
|
if( sv.Left(sValueName.size()) == sValueName )
|
||||||
vsValueNamesOut.insert( sv );
|
vsValueNamesOut.insert( sv );
|
||||||
else
|
else // we passed the last metric that matched sValueName
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user