mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 06:09:50 -06:00
Apply modernize-use-starts-ends-with
This commit is contained in:
@ -1017,11 +1017,11 @@ bool ESCore::IsIssuerCorrect(VerifyContainerType type, const ES::CertReader& iss
|
|||||||
switch (type)
|
switch (type)
|
||||||
{
|
{
|
||||||
case VerifyContainerType::TMD:
|
case VerifyContainerType::TMD:
|
||||||
return issuer_cert.GetName().compare(0, 2, "CP") == 0;
|
return issuer_cert.GetName().starts_with("CP");
|
||||||
case VerifyContainerType::Ticket:
|
case VerifyContainerType::Ticket:
|
||||||
return issuer_cert.GetName().compare(0, 2, "XS") == 0;
|
return issuer_cert.GetName().starts_with("XS");
|
||||||
case VerifyContainerType::Device:
|
case VerifyContainerType::Device:
|
||||||
return issuer_cert.GetName().compare(0, 2, "MS") == 0;
|
return issuer_cert.GetName().starts_with("MS");
|
||||||
default:
|
default:
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -43,7 +43,7 @@ HostFileSystem::HostFilename HostFileSystem::BuildFilename(const std::string& wi
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (wii_path.compare(0, 1, "/") == 0)
|
if (wii_path.starts_with("/"))
|
||||||
return HostFilename{m_root_path + Common::EscapePath(wii_path), false};
|
return HostFilename{m_root_path + Common::EscapePath(wii_path), false};
|
||||||
|
|
||||||
ASSERT_MSG(IOS_FS, false, "Invalid Wii path '{}' given to BuildFilename()", wii_path);
|
ASSERT_MSG(IOS_FS, false, "Invalid Wii path '{}' given to BuildFilename()", wii_path);
|
||||||
|
@ -673,16 +673,16 @@ std::optional<IPCReply> EmulationKernel::OpenDevice(OpenRequest& request)
|
|||||||
request.fd = new_fd;
|
request.fd = new_fd;
|
||||||
|
|
||||||
std::shared_ptr<Device> device;
|
std::shared_ptr<Device> device;
|
||||||
if (request.path.find("/dev/usb/oh0/") == 0 && !GetDeviceByName(request.path) &&
|
if (request.path.starts_with("/dev/usb/oh0/") && !GetDeviceByName(request.path) &&
|
||||||
!HasFeature(GetVersion(), Feature::NewUSB))
|
!HasFeature(GetVersion(), Feature::NewUSB))
|
||||||
{
|
{
|
||||||
device = std::make_shared<OH0Device>(*this, request.path);
|
device = std::make_shared<OH0Device>(*this, request.path);
|
||||||
}
|
}
|
||||||
else if (request.path.find("/dev/") == 0)
|
else if (request.path.starts_with("/dev/"))
|
||||||
{
|
{
|
||||||
device = GetDeviceByName(request.path);
|
device = GetDeviceByName(request.path);
|
||||||
}
|
}
|
||||||
else if (request.path.find('/') == 0)
|
else if (request.path.starts_with('/'))
|
||||||
{
|
{
|
||||||
device = GetDeviceByName("/dev/fs");
|
device = GetDeviceByName("/dev/fs");
|
||||||
}
|
}
|
||||||
|
@ -88,7 +88,7 @@ ResourcePack::ResourcePack(const std::string& path) : m_path(path)
|
|||||||
unzGetCurrentFileInfo64(file, &texture_info, filename.data(), static_cast<u16>(filename.size()),
|
unzGetCurrentFileInfo64(file, &texture_info, filename.data(), static_cast<u16>(filename.size()),
|
||||||
nullptr, 0, nullptr, 0);
|
nullptr, 0, nullptr, 0);
|
||||||
|
|
||||||
if (filename.compare(0, 9, "textures/") != 0 || texture_info.uncompressed_size == 0)
|
if (!filename.starts_with("textures/") || texture_info.uncompressed_size == 0)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
// If a texture is compressed and the manifest doesn't state that, abort.
|
// If a texture is compressed and the manifest doesn't state that, abort.
|
||||||
|
Reference in New Issue
Block a user