Skip to content

Commit

Permalink
Fix #7526, 5b77102: FiosItem::operator< must return false for equality (
Browse files Browse the repository at this point in the history
  • Loading branch information
glx22 committed Apr 19, 2019
1 parent ebd4f32 commit 66a8db9
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/fios.cpp
Expand Up @@ -52,16 +52,15 @@ extern void GetOldSaveGameName(const char *file, char *title, const char *last);
*/
bool FiosItem::operator< (const FiosItem &other) const
{
bool r = false;
int r = false;

if ((_savegame_sort_order & SORT_BY_NAME) == 0 && (*this).mtime != other.mtime) {
r = (*this).mtime < other.mtime;
r = (*this).mtime - other.mtime;
} else {
r = strcasecmp((*this).title, other.title) < 0;
r = strcasecmp((*this).title, other.title);
}

if (_savegame_sort_order & SORT_DESCENDING) r = !r;
return r;
if (r == 0) return false;
return (_savegame_sort_order & SORT_DESCENDING) ? r > 0 : r < 0;
}

FileList::~FileList()
Expand Down

0 comments on commit 66a8db9

Please sign in to comment.