From a9b953e6d41e7fd0c5d4c9de7c353d7a0204a784 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Wed, 12 Sep 2018 01:09:25 -0400 Subject: [PATCH] yuzu/configure_gamelist: Use std::array instead of std::vector for translatable strings We don't need to use an allocating container for these, given we know the fixed amount of strings being used. This is just a waste of memory. --- src/yuzu/configuration/configure_gamelist.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/yuzu/configuration/configure_gamelist.cpp b/src/yuzu/configuration/configure_gamelist.cpp index 1238356a82..20090ed29a 100644 --- a/src/yuzu/configuration/configure_gamelist.cpp +++ b/src/yuzu/configuration/configure_gamelist.cpp @@ -2,11 +2,14 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "core/core.h" +#include +#include + +#include "common/common_types.h" #include "core/settings.h" #include "ui_configure_gamelist.h" -#include "ui_settings.h" #include "yuzu/configuration/configure_gamelist.h" +#include "yuzu/ui_settings.h" ConfigureGameList::ConfigureGameList(QWidget* parent) : QWidget(parent), ui(new Ui::ConfigureGameList) { @@ -39,11 +42,11 @@ void ConfigureGameList::setConfiguration() { } void ConfigureGameList::InitializeIconSizeComboBox() { - static const std::vector> default_icon_sizes{ + static const std::array, 5> default_icon_sizes{{ std::make_pair(0, "None"), std::make_pair(32, "Small"), std::make_pair(64, "Standard"), std::make_pair(128, "Large"), std::make_pair(256, "Full Size"), - }; + }}; for (const auto& size : default_icon_sizes) { ui->icon_size_combobox->addItem(QString::fromStdString(size.second + " (" + @@ -54,12 +57,12 @@ void ConfigureGameList::InitializeIconSizeComboBox() { } void ConfigureGameList::InitializeRowComboBoxes() { - static const std::vector row_text_names{ + static const std::array row_text_names{{ "Filename", "Filetype", "Title ID", "Title Name", - }; + }}; for (size_t i = 0; i < row_text_names.size(); ++i) { ui->row_1_text_combobox->addItem(QString::fromStdString(row_text_names[i]),