From 07fd0101dc525467987088f6e43b17bc34e0e160 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Sat, 13 Nov 2004 21:07:10 +0000 Subject: [PATCH] simplify --- stepmania/src/NotesLoaderBMS.cpp | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/stepmania/src/NotesLoaderBMS.cpp b/stepmania/src/NotesLoaderBMS.cpp index 33c73b1b5b..da680fd3ba 100644 --- a/stepmania/src/NotesLoaderBMS.cpp +++ b/stepmania/src/NotesLoaderBMS.cpp @@ -889,19 +889,18 @@ bool BMSLoader::LoadFromDir( CString sDir, Song &out ) { for( unsigned i=0; i < aBMSData.size(); i++ ) { - CString sTitle; // Declare here for less memory thrashing - if( GetTagFromMap( aBMSData[i], "#title", sTitle ) ) + CString sTitle; + if( !GetTagFromMap( aBMSData[i], "#title", sTitle ) ) + continue; + + commonSubstring = FindLargestCommonSubstring( commonSubstring, sTitle ); + if( commonSubstring == "" ) { - commonSubstring = FindLargestCommonSubstring( commonSubstring, sTitle ); - if( commonSubstring == "" ) - { - // All bets are off; the titles don't match at all. - // At this rate we're lucky if we even get the title right. - LOG->Warn("BMS files in %s have inconsistent titles", sDir.c_str() ); - break; - } + // All bets are off; the titles don't match at all. + // At this rate we're lucky if we even get the title right. + LOG->Warn("BMS files in %s have inconsistent titles", sDir.c_str() ); + break; } - // else no comparison, this file is missing a #title tag. } } // Yay, we have our substring. (something like "LION SUKI")