Misc: Remove StringUtil::{Starts,Ends}With, use C++20
This commit is contained in:
@ -326,7 +326,7 @@ void DInputSource::UpdateMotorState(InputBindingKey large_key, InputBindingKey s
|
||||
std::optional<InputBindingKey> DInputSource::ParseKeyString(const std::string_view& device,
|
||||
const std::string_view& binding)
|
||||
{
|
||||
if (!StringUtil::StartsWith(device, "DInput-") || binding.empty())
|
||||
if (!device.starts_with("DInput-") || binding.empty())
|
||||
return std::nullopt;
|
||||
|
||||
const std::optional<s32> player_id = StringUtil::FromChars<s32>(device.substr(7));
|
||||
@ -337,7 +337,7 @@ std::optional<InputBindingKey> DInputSource::ParseKeyString(const std::string_vi
|
||||
key.source_type = InputSourceType::DInput;
|
||||
key.source_index = static_cast<u32>(player_id.value());
|
||||
|
||||
if (StringUtil::StartsWith(binding, "+Axis") || StringUtil::StartsWith(binding, "-Axis"))
|
||||
if (binding.starts_with("+Axis") || binding.starts_with("-Axis"))
|
||||
{
|
||||
std::string_view end;
|
||||
const std::optional<u32> axis_index = StringUtil::FromChars<u32>(binding.substr(5), 10, &end);
|
||||
@ -350,7 +350,7 @@ std::optional<InputBindingKey> DInputSource::ParseKeyString(const std::string_vi
|
||||
key.invert = (end == "~");
|
||||
return key;
|
||||
}
|
||||
else if (StringUtil::StartsWith(binding, "FullAxis"))
|
||||
else if (binding.starts_with("FullAxis"))
|
||||
{
|
||||
std::string_view end;
|
||||
const std::optional<u32> axis_index = StringUtil::FromChars<u32>(binding.substr(8), 10, &end);
|
||||
@ -363,7 +363,7 @@ std::optional<InputBindingKey> DInputSource::ParseKeyString(const std::string_vi
|
||||
key.invert = (end == "~");
|
||||
return key;
|
||||
}
|
||||
else if (StringUtil::StartsWith(binding, "Hat"))
|
||||
else if (binding.starts_with("Hat"))
|
||||
{
|
||||
if (binding[3] < '0' || binding[3] > '9' || binding.length() < 5)
|
||||
return std::nullopt;
|
||||
@ -383,7 +383,7 @@ std::optional<InputBindingKey> DInputSource::ParseKeyString(const std::string_vi
|
||||
// bad direction
|
||||
return std::nullopt;
|
||||
}
|
||||
else if (StringUtil::StartsWith(binding, "Button"))
|
||||
else if (binding.starts_with("Button"))
|
||||
{
|
||||
const std::optional<u32> button_index = StringUtil::FromChars<u32>(binding.substr(6));
|
||||
if (!button_index.has_value())
|
||||
|
||||
Reference in New Issue
Block a user