mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-23 02:42:16 -07:00
make defaultSort logic easier to follow
This commit is contained in:
parent
006476b4c6
commit
6239fe5a72
1 changed files with 5 additions and 5 deletions
|
|
@ -218,13 +218,13 @@ void SetList::defaultSort()
|
||||||
CardSet::Priority bPriority = b->getPriority() ? b->getPriority() : CardSet::PriorityFallback;
|
CardSet::Priority bPriority = b->getPriority() ? b->getPriority() : CardSet::PriorityFallback;
|
||||||
|
|
||||||
// Sort by priority, then by release date, then by short name
|
// Sort by priority, then by release date, then by short name
|
||||||
if (aPriority == bPriority) {
|
if (aPriority != bPriority) {
|
||||||
if (aDate.daysTo(bDate) == 0) {
|
return aPriority < bPriority;
|
||||||
return a->getShortName().compare(b->getShortName()) < 0;
|
}
|
||||||
}
|
if (aDate.daysTo(bDate) != 0) {
|
||||||
return aDate.daysTo(bDate) < 0;
|
return aDate.daysTo(bDate) < 0;
|
||||||
}
|
}
|
||||||
return aPriority < bPriority;
|
return a->getShortName().compare(b->getShortName()) < 0;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue