mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-13 17:44:48 -07:00
Properly check if a duplicate already exists in the list, no longer break loop. (#5470)
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
This commit is contained in:
parent
f6c1253e84
commit
c079715c46
2 changed files with 8 additions and 2 deletions
|
|
@ -103,8 +103,9 @@ QList<CardInfoPerSet> PrintingSelectorCardSortingWidget::sortSets(const CardInfo
|
||||||
for (auto it = cardInfoPerSets.begin(); it != cardInfoPerSets.end(); ++it) {
|
for (auto it = cardInfoPerSets.begin(); it != cardInfoPerSets.end(); ++it) {
|
||||||
for (const auto &cardInfoPerSet : it.value()) {
|
for (const auto &cardInfoPerSet : it.value()) {
|
||||||
if (cardInfoPerSet.getPtr() == set) {
|
if (cardInfoPerSet.getPtr() == set) {
|
||||||
sortedCardInfoPerSets << cardInfoPerSet;
|
if (!sortedCardInfoPerSets.contains(cardInfoPerSet)) {
|
||||||
break;
|
sortedCardInfoPerSets << cardInfoPerSet;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -144,6 +144,11 @@ public:
|
||||||
explicit CardInfoPerSet(const CardSetPtr &_set = QSharedPointer<CardSet>(nullptr));
|
explicit CardInfoPerSet(const CardSetPtr &_set = QSharedPointer<CardSet>(nullptr));
|
||||||
~CardInfoPerSet() = default;
|
~CardInfoPerSet() = default;
|
||||||
|
|
||||||
|
bool operator==(const CardInfoPerSet &other) const
|
||||||
|
{
|
||||||
|
return this->set == other.set && this->properties == other.properties;
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
CardSetPtr set;
|
CardSetPtr set;
|
||||||
// per-set card properties;
|
// per-set card properties;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue