Simplify.

This commit is contained in:
Glenn Maynard
2003-07-12 20:16:07 +00:00
parent cb622760d8
commit 9db916b94f
+8 -16
View File
@@ -77,18 +77,14 @@ bool UnlockSystem::CourseIsLocked( const Course *course )
bool UnlockSystem::SongIsLocked( const Song *song ) bool UnlockSystem::SongIsLocked( const Song *song )
{ {
SongEntry *p = FindSong( song ); SongEntry *p = FindSong( song );
if( p == NULL )
return false;
CString tmp; p->updateLocked();
if (p) LOG->Trace( "current status: %slocked", p->isLocked? "":"un" );
{
p->updateLocked();
if (!p->isLocked) tmp = "un"; return p->isLocked;
LOG->Trace( "current status: %slocked", tmp.c_str() );
}
return (p != NULL) && (p->isLocked);
} }
bool UnlockSystem::SongIsRoulette( const Song *song ) bool UnlockSystem::SongIsRoulette( const Song *song )
@@ -107,9 +103,8 @@ bool UnlockSystem::SongIsRoulette( const Song *song )
SongEntry *UnlockSystem::FindSong( CString songname ) SongEntry *UnlockSystem::FindSong( CString songname )
{ {
songname.MakeUpper(); for(unsigned i = 0; i < m_SongEntries.size(); i++)
for(int i = 0; i < m_SongEntries.size(); i++) if (!songname.CompareNoCase(m_SongEntries[i].m_sSongName))
if (songname == m_SongEntries[i].m_sSongName)
return &m_SongEntries[i]; return &m_SongEntries[i];
return NULL; return NULL;
@@ -119,12 +114,9 @@ SongEntry *UnlockSystem::FindCourse( const Course *pCourse )
{ {
CString CourseName = pCourse->m_sTranslitName; CString CourseName = pCourse->m_sTranslitName;
CourseName.MakeUpper();
for(unsigned i = 0; i < m_SongEntries.size(); i++) for(unsigned i = 0; i < m_SongEntries.size(); i++)
{ {
if( !CourseName.CompareNoCase(m_SongEntries[i].m_sSongName) )
if( CourseName == m_SongEntries[i].m_sSongName )
return &m_SongEntries[i]; return &m_SongEntries[i];
} }