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.
This commit is contained in:
Lioncash 2024-01-31 12:09:33 -05:00
parent a1879ea099
commit 81aca79145
2 changed files with 3 additions and 3 deletions

View File

@ -185,7 +185,7 @@ void GraphicsModListWidget::ModItemChanged(QListWidgetItem* item)
m_needs_save = true;
}
void GraphicsModListWidget::OnModChanged(std::optional<std::string> absolute_path)
void GraphicsModListWidget::OnModChanged(const std::optional<std::string>& absolute_path)
{
ClearLayoutRecursively(m_mod_meta_layout);
@ -198,7 +198,7 @@ void GraphicsModListWidget::OnModChanged(std::optional<std::string> absolute_pat
return;
}
GraphicsModConfig* mod = m_mod_group.GetMod(*absolute_path);
const GraphicsModConfig* mod = m_mod_group.GetMod(*absolute_path);
if (!mod)
return;

View File

@ -52,7 +52,7 @@ private:
void ModSelectionChanged();
void ModItemChanged(QListWidgetItem* item);
void OnModChanged(std::optional<std::string> absolute_path);
void OnModChanged(const std::optional<std::string>& absolute_path);
void SaveModList();