From cfaca94b4c2a7844f5d7209a7f572a43dc742dce Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Thu, 19 May 2005 20:36:34 +0000 Subject: [PATCH] remove hack. the problem was probably that CompareNoCase returns a value < 0, not necessarily -1 --- stepmania/src/CourseUtil.cpp | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/stepmania/src/CourseUtil.cpp b/stepmania/src/CourseUtil.cpp index 7a8ad35cae..b97d29ccd4 100644 --- a/stepmania/src/CourseUtil.cpp +++ b/stepmania/src/CourseUtil.cpp @@ -15,19 +15,9 @@ // static bool CompareCoursePointersByName( const Course* pCourse1, const Course* pCourse2 ) { - // HACK: strcmp and other string comparators appear to eat whitespace. - // For example, the string "Players Best 13-16" is sorted between - // "Players Best 1-4" and "Players Best 5-8". Replace the string " " - // with " 0" for comparison only. - - // XXX: That doesn't happen to me, and it shouldn't (strcmp is strictly - // a byte sort, though CompareNoCase doesn't use strcmp). Are you sure - // you didn't have only one space before? -glenn CString sName1 = pCourse1->GetFullDisplayTitle(); CString sName2 = pCourse2->GetFullDisplayTitle(); - sName1.Replace( " " , " 0" ); - sName2.Replace( " " , " 0" ); - return sName1.CompareNoCase( sName2 ) == -1; + return sName1.CompareNoCase( sName2 ) < 0; } static bool CompareCoursePointersByAutogen( const Course* pCourse1, const Course* pCourse2 )