mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 15:40:19 +00:00
Chess: Don't use Vector in a literal iterator
This commit is contained in:
parent
a79a9fb692
commit
1a8c8d2383
Notes:
sideshowbarker
2024-07-17 20:04:24 +09:00
Author: https://github.com/kleinesfilmroellchen Commit: https://github.com/SerenityOS/serenity/commit/1a8c8d23830 Pull-request: https://github.com/SerenityOS/serenity/pull/12162 Reviewed-by: https://github.com/AtkinsSJ
2 changed files with 3 additions and 3 deletions
|
@ -22,7 +22,7 @@ PromotionDialog::PromotionDialog(ChessWidget& chess_widget)
|
|||
main_widget.set_fill_with_background_color(true);
|
||||
main_widget.set_layout<GUI::HorizontalBoxLayout>();
|
||||
|
||||
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<GUI::Button>("");
|
||||
button.set_fixed_height(70);
|
||||
button.set_icon(chess_widget.get_piece_graphic({ chess_widget.board().turn(), type }));
|
||||
|
|
|
@ -138,7 +138,7 @@ ErrorOr<int> 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<int> 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);
|
||||
|
|
Loading…
Reference in a new issue