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:
BruebachL 2025-01-14 16:12:53 +01:00 committed by GitHub
parent f6c1253e84
commit c079715c46
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 8 additions and 2 deletions

View file

@ -103,8 +103,9 @@ QList<CardInfoPerSet> PrintingSelectorCardSortingWidget::sortSets(const CardInfo
for (auto it = cardInfoPerSets.begin(); it != cardInfoPerSets.end(); ++it) {
for (const auto &cardInfoPerSet : it.value()) {
if (cardInfoPerSet.getPtr() == set) {
sortedCardInfoPerSets << cardInfoPerSet;
break;
if (!sortedCardInfoPerSets.contains(cardInfoPerSet)) {
sortedCardInfoPerSets << cardInfoPerSet;
}
}
}
}