diff --git a/cockatrice/src/game_graphics/tally/subtype_tally.cpp b/cockatrice/src/game_graphics/tally/subtype_tally.cpp index 5d34f6874..804443b15 100644 --- a/cockatrice/src/game_graphics/tally/subtype_tally.cpp +++ b/cockatrice/src/game_graphics/tally/subtype_tally.cpp @@ -66,8 +66,9 @@ QList countSubtypes(const QList &cards) }); // convert entries into TallyRows - QList rows = QList(entries.size()); - std::transform(entries.begin(), entries.end(), rows.begin(), + QList rows; + rows.reserve(entries.size()); // for backwards compatibility with Qt5 + std::transform(entries.begin(), entries.end(), std::back_inserter(rows), [](const SubtypeEntry &e) { return TallyRow{e.name, QString::number(e.count)}; }); return rows;