mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-10 00:04:48 -07:00
replace foreach macro with standard for each loop (#5485)
This commit is contained in:
parent
0cbad25385
commit
c148c8df7f
17 changed files with 31 additions and 31 deletions
|
|
@ -468,7 +468,7 @@ CardInfoPtr CardDatabase::getCard(const QString &cardName) const
|
|||
QList<CardInfoPtr> CardDatabase::getCards(const QStringList &cardNames) const
|
||||
{
|
||||
QList<CardInfoPtr> cardInfos;
|
||||
foreach (QString cardName, cardNames) {
|
||||
for (const QString &cardName : cardNames) {
|
||||
CardInfoPtr ptr = getCardFromMap(cards, cardName);
|
||||
if (ptr)
|
||||
cardInfos.append(ptr);
|
||||
|
|
@ -783,7 +783,7 @@ void CardDatabase::refreshCachedReverseRelatedCards()
|
|||
continue;
|
||||
}
|
||||
|
||||
foreach (CardRelation *cardRelation, card->getReverseRelatedCards()) {
|
||||
for (CardRelation *cardRelation : card->getReverseRelatedCards()) {
|
||||
const QString &targetCard = cardRelation->getName();
|
||||
if (!cards.contains(targetCard)) {
|
||||
continue;
|
||||
|
|
@ -886,7 +886,7 @@ CardRelation::CardRelation(const QString &_name,
|
|||
|
||||
void CardInfo::resetReverseRelatedCards2Me()
|
||||
{
|
||||
foreach (CardRelation *cardRelation, this->getReverseRelatedCards2Me()) {
|
||||
for (CardRelation *cardRelation : this->getReverseRelatedCards2Me()) {
|
||||
cardRelation->deleteLater();
|
||||
}
|
||||
reverseRelatedCardsToMe = QList<CardRelation *>();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue