From 239c4f8f94314785b7a9135a7639d93f0b4e2955 Mon Sep 17 00:00:00 2001 From: Sander Speetjens Date: Sat, 18 Oct 2025 11:52:59 +0200 Subject: [PATCH] Fix clazy warning reference instead of copy --- UI/ui_combobox.cpp | 2 +- UI/ui_tab_widget.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/UI/ui_combobox.cpp b/UI/ui_combobox.cpp index 29be3fa..bb1f686 100644 --- a/UI/ui_combobox.cpp +++ b/UI/ui_combobox.cpp @@ -49,7 +49,7 @@ void UI_combobox::from_json(const json &j) if (j.contains("options")) { this->m_options.clear(); - for (auto option : j["options"]) + for (auto &option : j["options"]) { this->m_options.push_back(option); } diff --git a/UI/ui_tab_widget.cpp b/UI/ui_tab_widget.cpp index 3126a99..9d8450c 100644 --- a/UI/ui_tab_widget.cpp +++ b/UI/ui_tab_widget.cpp @@ -70,7 +70,7 @@ void UI_tab_widget::from_json(const json &j) if (j.contains("tab_names")) { this->m_tab_names.clear(); - for (auto option : j["tab_names"]) + for (auto &option : j["tab_names"]) { this->m_tab_names.push_back(option); } @@ -78,7 +78,7 @@ void UI_tab_widget::from_json(const json &j) if (j.contains("tab_visible")) { this->m_tab_visible.clear(); - for (auto option : j["tab_visible"]) + for (auto &option : j["tab_visible"]) { this->m_tab_visible.push_back(option); }