From 81aca79145c1f4618d2f7e3ba41e8840e2d98684 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Wed, 31 Jan 2024 12:09:33 -0500 Subject: [PATCH] GraphicsModListWidget: Pass optional by const reference All we do is read from it, so we don't need to copy the string if we happen to have one. --- Source/Core/DolphinQt/Config/GraphicsModListWidget.cpp | 4 ++-- Source/Core/DolphinQt/Config/GraphicsModListWidget.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Source/Core/DolphinQt/Config/GraphicsModListWidget.cpp b/Source/Core/DolphinQt/Config/GraphicsModListWidget.cpp index 2151642d2b..f8f0bc86db 100644 --- a/Source/Core/DolphinQt/Config/GraphicsModListWidget.cpp +++ b/Source/Core/DolphinQt/Config/GraphicsModListWidget.cpp @@ -185,7 +185,7 @@ void GraphicsModListWidget::ModItemChanged(QListWidgetItem* item) m_needs_save = true; } -void GraphicsModListWidget::OnModChanged(std::optional absolute_path) +void GraphicsModListWidget::OnModChanged(const std::optional& absolute_path) { ClearLayoutRecursively(m_mod_meta_layout); @@ -198,7 +198,7 @@ void GraphicsModListWidget::OnModChanged(std::optional absolute_pat return; } - GraphicsModConfig* mod = m_mod_group.GetMod(*absolute_path); + const GraphicsModConfig* mod = m_mod_group.GetMod(*absolute_path); if (!mod) return; diff --git a/Source/Core/DolphinQt/Config/GraphicsModListWidget.h b/Source/Core/DolphinQt/Config/GraphicsModListWidget.h index 7b32792cff..ff310af56c 100644 --- a/Source/Core/DolphinQt/Config/GraphicsModListWidget.h +++ b/Source/Core/DolphinQt/Config/GraphicsModListWidget.h @@ -52,7 +52,7 @@ private: void ModSelectionChanged(); void ModItemChanged(QListWidgetItem* item); - void OnModChanged(std::optional absolute_path); + void OnModChanged(const std::optional& absolute_path); void SaveModList();