Simple loop...or is it?

I wonder if a goodie can be utilized here.
This commit is contained in:
Jason Felds
2013-04-28 23:40:57 -04:00
parent f61d89f241
commit d28878ce0a
+3 -3
View File
@@ -103,11 +103,11 @@ int RageSoundReader_Chain::GetSampleRateInternal() const
return m_iPreferredSampleRate;
int iRate = -1;
FOREACH_CONST( RageSoundReader *, m_apLoadedSounds, it )
for (RageSoundReader const *it : m_apLoadedSounds)
{
if( iRate == -1 )
iRate = (*it)->GetSampleRate();
else if( iRate != (*it)->GetSampleRate() )
iRate = it->GetSampleRate();
else if( iRate != it->GetSampleRate() )
return -1;
}
return iRate;