From 1ea284e9104a8dc419a98ed4c069fc8711d4e32c Mon Sep 17 00:00:00 2001 From: John Bauer Date: Thu, 19 Oct 2006 23:17:42 +0000 Subject: [PATCH] Using the || operator makes the operator< invalid, because the following is true: ("foo", "bar") < ("bar", "foo") < is true for second string ("bar", "foo") < ("foo", "bar") < is true for first string We fix this by fully comparing one string, then trying the other one. --- stepmania/src/CourseUtil.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/stepmania/src/CourseUtil.h b/stepmania/src/CourseUtil.h index 614fd81c16..37a22fcee4 100644 --- a/stepmania/src/CourseUtil.h +++ b/stepmania/src/CourseUtil.h @@ -45,7 +45,9 @@ public: const RString &GetPath() const { return sPath; } bool operator<( const CourseID &other ) const { - return sPath < other.sPath || sFullTitle < other.sFullTitle; + if (sPath != other.sPath) + return sPath < other.sPath; + return sFullTitle < other.sFullTitle; } XNode* CreateNode() const;