Simplify const

This commit is contained in:
Lukas Brübach 2026-09-07 21:22:05 +02:00
parent 331fb24125
commit 9d7ce3fcaa

View file

@ -101,12 +101,8 @@ bool OracleImporter::readSetsFromByteArray(QByteArray data)
* types (e.g. "Artifact Creature") or multiple faces (e.g. split/adventure cards). * types (e.g. "Artifact Creature") or multiple faces (e.g. split/adventure cards).
* A lower index means a higher priority. * A lower index means a higher priority.
*/ */
static const QStringList &mainCardTypePriority() static const QStringList MAIN_CARD_TYPE_PRIORITY = {"Planeswalker", "Creature", "Land", "Sorcery",
{ "Instant", "Artifact", "Enchantment"};
static const QStringList priority = {"Planeswalker", "Creature", "Land", "Sorcery",
"Instant", "Artifact", "Enchantment"};
return priority;
}
/** /**
* Returns the priority (index) of the given main card type. Known types map to their * Returns the priority (index) of the given main card type. Known types map to their
@ -114,7 +110,7 @@ static const QStringList &mainCardTypePriority()
*/ */
static int mainCardTypePriority(const QString &mainCardType) static int mainCardTypePriority(const QString &mainCardType)
{ {
return mainCardTypePriority().indexOf(mainCardType); return MAIN_CARD_TYPE_PRIORITY.indexOf(mainCardType);
} }
static QString getMainCardType(const QStringList &typeList) static QString getMainCardType(const QStringList &typeList)
@ -123,7 +119,7 @@ static QString getMainCardType(const QStringList &typeList)
return {}; return {};
} }
for (const auto &type : mainCardTypePriority()) { for (const auto &type : MAIN_CARD_TYPE_PRIORITY) {
if (typeList.contains(type)) { if (typeList.contains(type)) {
return type; return type;
} }