GraphicsModGroup: Allow heterogenous lookup for GetMod()

Allows using keys that aren't directly std::string as the key. This lets
us use std::string_view for the incoming path name, making it more
flexible with other string types.
This commit is contained in:
Lioncash
2024-01-31 12:05:15 -05:00
parent 30fdf25f8f
commit a1879ea099
2 changed files with 6 additions and 5 deletions

View File

@ -7,6 +7,8 @@
#include <sstream>
#include <string>
#include <picojson.h>
#include "Common/CommonPaths.h"
#include "Common/FileSearch.h"
#include "Common/FileUtil.h"
@ -174,7 +176,7 @@ std::vector<GraphicsModConfig>& GraphicsModGroupConfig::GetMods()
return m_graphics_mods;
}
GraphicsModConfig* GraphicsModGroupConfig::GetMod(const std::string& absolute_path) const
GraphicsModConfig* GraphicsModGroupConfig::GetMod(std::string_view absolute_path) const
{
if (const auto iter = m_path_to_graphics_mod.find(absolute_path);
iter != m_path_to_graphics_mod.end())