From 1a8c8d2383039d41f235baca7d8143a168b0f870 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?kleines=20Filmr=C3=B6llchen?= Date: Thu, 27 Jan 2022 13:09:26 +0100 Subject: [PATCH] Chess: Don't use Vector in a literal iterator --- Userland/Games/Chess/PromotionDialog.cpp | 2 +- Userland/Games/Chess/main.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Userland/Games/Chess/PromotionDialog.cpp b/Userland/Games/Chess/PromotionDialog.cpp index 20c4bea0974..e89bd54d9ef 100644 --- a/Userland/Games/Chess/PromotionDialog.cpp +++ b/Userland/Games/Chess/PromotionDialog.cpp @@ -22,7 +22,7 @@ PromotionDialog::PromotionDialog(ChessWidget& chess_widget) main_widget.set_fill_with_background_color(true); main_widget.set_layout(); - for (auto& type : Vector({ Chess::Type::Queen, Chess::Type::Knight, Chess::Type::Rook, Chess::Type::Bishop })) { + for (auto const& type : { Chess::Type::Queen, Chess::Type::Knight, Chess::Type::Rook, Chess::Type::Bishop }) { auto& button = main_widget.add(""); button.set_fixed_height(70); button.set_icon(chess_widget.get_piece_graphic({ chess_widget.board().turn(), type })); diff --git a/Userland/Games/Chess/main.cpp b/Userland/Games/Chess/main.cpp index 7dc21e13f64..28727f2a64b 100644 --- a/Userland/Games/Chess/main.cpp +++ b/Userland/Games/Chess/main.cpp @@ -138,7 +138,7 @@ ErrorOr serenity_main(Main::Arguments arguments) auto board_theme_menu = TRY(style_menu->try_add_submenu("Board Theme")); board_theme_menu->set_icon(Gfx::Bitmap::try_load_from_file("/res/icons/chess/mini-board.png").release_value_but_fixme_should_propagate_errors()); - for (auto& theme : Vector({ "Beige", "Green", "Blue" })) { + for (auto const& theme : { "Beige", "Green", "Blue" }) { auto action = GUI::Action::create_checkable(theme, [&](auto& action) { widget->set_board_theme(action.text()); widget->update(); @@ -171,7 +171,7 @@ ErrorOr serenity_main(Main::Arguments arguments) GUI::ActionGroup engines_action_group; engines_action_group.set_exclusive(true); auto engine_submenu = TRY(engine_menu->try_add_submenu("&Engine")); - for (auto& engine : Vector({ "Human", "ChessEngine" })) { + for (auto const& engine : { "Human", "ChessEngine" }) { auto action = GUI::Action::create_checkable(engine, [&](auto& action) { if (action.text() == "Human") { widget->set_engine(nullptr);