mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-22 05:40:01 -06:00
IOS: Allow for heterogenous name lookup
Allows lookups to be done with std::string_view or any other string type. This allows for non-allocating strings to be used with the name lookup without needing to construct a std::string.
This commit is contained in:
@ -505,14 +505,14 @@ s32 Kernel::GetFreeDeviceID()
|
||||
return -1;
|
||||
}
|
||||
|
||||
std::shared_ptr<Device::Device> Kernel::GetDeviceByName(const std::string& device_name)
|
||||
std::shared_ptr<Device::Device> Kernel::GetDeviceByName(std::string_view device_name)
|
||||
{
|
||||
std::lock_guard lock(m_device_map_mutex);
|
||||
const auto iterator = m_device_map.find(device_name);
|
||||
return iterator != m_device_map.end() ? iterator->second : nullptr;
|
||||
}
|
||||
|
||||
std::shared_ptr<Device::Device> EmulationKernel::GetDeviceByName(const std::string& device_name)
|
||||
std::shared_ptr<Device::Device> EmulationKernel::GetDeviceByName(std::string_view device_name)
|
||||
{
|
||||
return Kernel::GetDeviceByName(device_name);
|
||||
}
|
||||
|
Reference in New Issue
Block a user