diff --git a/src/core/kernel/support/EmuFile.cpp b/src/core/kernel/support/EmuFile.cpp index 79b34b441..84f297f94 100644 --- a/src/core/kernel/support/EmuFile.cpp +++ b/src/core/kernel/support/EmuFile.cpp @@ -609,18 +609,18 @@ int CxbxDeviceIndexByHostPath(const char * HostDevicePath) return -1; } -XboxDevice *CxbxDeviceByDevicePath(const std::string XboxDevicePath) +XboxDevice *CxbxDeviceByDevicePath(const std::string_view XboxDevicePath) { - int DeviceIndex = CxbxDeviceIndexByDevicePath(XboxDevicePath.c_str()); + int DeviceIndex = CxbxDeviceIndexByDevicePath(XboxDevicePath.data()); if (DeviceIndex >= 0) return &Devices[DeviceIndex]; return nullptr; } -XboxDevice *CxbxDeviceByHostPath(const std::string HostDevicePath) +XboxDevice *CxbxDeviceByHostPath(const std::string_view HostDevicePath) { - int DeviceIndex = CxbxDeviceIndexByHostPath(HostDevicePath.c_str()); + int DeviceIndex = CxbxDeviceIndexByHostPath(HostDevicePath.data()); if (DeviceIndex >= 0) return &Devices[DeviceIndex]; diff --git a/src/core/kernel/support/EmuFile.h b/src/core/kernel/support/EmuFile.h index cfd99747d..c1249ac91 100644 --- a/src/core/kernel/support/EmuFile.h +++ b/src/core/kernel/support/EmuFile.h @@ -220,8 +220,8 @@ CHAR* NtStatusToString(IN NTSTATUS Status); int CxbxRegisterDeviceHostPath(std::string_view XboxFullPath, std::string HostDevicePath, bool IsFile = false); int CxbxDeviceIndexByDevicePath(const char *XboxDevicePath); -XboxDevice *CxbxDeviceByDevicePath(const std::string XboxDevicePath); -XboxDevice* CxbxDeviceByHostPath(const std::string HostPath); +XboxDevice *CxbxDeviceByDevicePath(const std::string_view XboxDevicePath); +XboxDevice* CxbxDeviceByHostPath(const std::string_view HostPath); std::string CxbxConvertXboxToHostPath(const std::string_view XboxDevicePath); char SymbolicLinkToDriveLetter(std::string aSymbolicLinkName);