mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-31 10:09:36 -06:00
StringUtil: Make SplitString return by value
Simpler usage.
This commit is contained in:
@ -175,8 +175,6 @@ std::vector<ARCode> LoadCodes(const IniFile& global_ini, const IniFile& local_in
|
||||
continue;
|
||||
}
|
||||
|
||||
std::vector<std::string> pieces;
|
||||
|
||||
// Check if the line is a name of the code
|
||||
if (line[0] == '$')
|
||||
{
|
||||
@ -199,7 +197,7 @@ std::vector<ARCode> LoadCodes(const IniFile& global_ini, const IniFile& local_in
|
||||
}
|
||||
else
|
||||
{
|
||||
SplitString(line, ' ', pieces);
|
||||
std::vector<std::string> pieces = SplitString(line, ' ');
|
||||
|
||||
// Check if the AR code is decrypted
|
||||
if (pieces.size() == 2 && pieces[0].size() == 8 && pieces[1].size() == 8)
|
||||
@ -225,7 +223,7 @@ std::vector<ARCode> LoadCodes(const IniFile& global_ini, const IniFile& local_in
|
||||
}
|
||||
else
|
||||
{
|
||||
SplitString(line, '-', pieces);
|
||||
pieces = SplitString(line, '-');
|
||||
if (pieces.size() == 3 && pieces[0].size() == 4 && pieces[1].size() == 4 &&
|
||||
pieces[2].size() == 5)
|
||||
{
|
||||
|
@ -686,10 +686,8 @@ void SConfig::LoadUSBPassthroughSettings(IniFile& ini)
|
||||
IniFile::Section* section = ini.GetOrCreateSection("USBPassthrough");
|
||||
m_usb_passthrough_devices.clear();
|
||||
std::string devices_string;
|
||||
std::vector<std::string> pairs;
|
||||
section->Get("Devices", &devices_string, "");
|
||||
SplitString(devices_string, ',', pairs);
|
||||
for (const auto& pair : pairs)
|
||||
for (const auto& pair : SplitString(devices_string, ','))
|
||||
{
|
||||
const auto index = pair.find(':');
|
||||
if (index == std::string::npos)
|
||||
|
@ -520,9 +520,7 @@ void BluetoothReal::LoadLinkKeys()
|
||||
const std::string& entries = SConfig::GetInstance().m_bt_passthrough_link_keys;
|
||||
if (entries.empty())
|
||||
return;
|
||||
std::vector<std::string> pairs;
|
||||
SplitString(entries, ',', pairs);
|
||||
for (const auto& pair : pairs)
|
||||
for (const auto& pair : SplitString(entries, ','))
|
||||
{
|
||||
const auto index = pair.find('=');
|
||||
if (index == std::string::npos)
|
||||
|
@ -86,8 +86,7 @@ void LoadPatchSection(const std::string& section, std::vector<Patch>& patches, I
|
||||
line[loc] = ':';
|
||||
}
|
||||
|
||||
std::vector<std::string> items;
|
||||
SplitString(line, ':', items);
|
||||
const std::vector<std::string> items = SplitString(line, ':');
|
||||
|
||||
if (items.size() >= 3)
|
||||
{
|
||||
|
Reference in New Issue
Block a user