From 08da79a366e41b20953daed7cb4b2aaec0686a1b Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Sat, 7 Sep 2002 06:46:18 +0000 Subject: [PATCH] Remove a CMap. This is simpler, anyway. --- stepmania/src/ScreenSelectGroup.cpp | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/stepmania/src/ScreenSelectGroup.cpp b/stepmania/src/ScreenSelectGroup.cpp index 2464919cb8..a6566d9055 100644 --- a/stepmania/src/ScreenSelectGroup.cpp +++ b/stepmania/src/ScreenSelectGroup.cpp @@ -79,21 +79,18 @@ ScreenSelectGroup::ScreenSelectGroup() aAllSongs.RemoveAt( i ); } - // Get group names by thowing them into a hash - CMapStringToString mapGroupToNothing; - for( i=0; im_sGroupName ] = ""; - CStringArray asGroupNames; - - // Read group names back out into asGroupNames - for( POSITION pos = mapGroupToNothing.GetStartPosition(); pos != NULL; ) - { - CString sGroupName, sValue; - mapGroupToNothing.GetNextAssoc( pos, sGroupName, sValue ); - asGroupNames.Add( sGroupName ); + for( i=0; im_sGroupName ); } - SortCStringArray( asGroupNames, true ); + + /* Remove duplicate groups. */ + SortCStringArray(asGroupNames, true); + for( i=asGroupNames.GetSize()-1; i > 0; --i ) { + if( asGroupNames[i] == asGroupNames[i-1] ) + asGroupNames.RemoveAt( i ); + } + asGroupNames.InsertAt(0, "ALL MUSIC" ); // Add songs to the MusicList.