mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-30 09:39:46 -06:00
StringUtil: Make SplitString return by value
Simpler usage.
This commit is contained in:
@ -94,8 +94,8 @@ void ARCodeAddEdit::SaveCheatData(wxCommandEvent& WXUNUSED(event))
|
||||
std::vector<std::string> encrypted_lines;
|
||||
|
||||
// Split the entered cheat into lines.
|
||||
std::vector<std::string> input_lines;
|
||||
SplitString(WxStrToStr(m_cheat_codes->GetValue()), '\n', input_lines);
|
||||
const std::vector<std::string> input_lines =
|
||||
SplitString(WxStrToStr(m_cheat_codes->GetValue()), '\n');
|
||||
|
||||
for (size_t i = 0; i < input_lines.size(); i++)
|
||||
{
|
||||
@ -106,8 +106,7 @@ void ARCodeAddEdit::SaveCheatData(wxCommandEvent& WXUNUSED(event))
|
||||
continue;
|
||||
|
||||
// Let's parse the current line. Is it in encrypted or decrypted form?
|
||||
std::vector<std::string> pieces;
|
||||
SplitString(line_str, ' ', pieces);
|
||||
std::vector<std::string> pieces = SplitString(line_str, ' ');
|
||||
|
||||
if (pieces.size() == 2 && pieces[0].size() == 8 && pieces[1].size() == 8)
|
||||
{
|
||||
@ -120,7 +119,7 @@ void ARCodeAddEdit::SaveCheatData(wxCommandEvent& WXUNUSED(event))
|
||||
}
|
||||
else if (pieces.size() == 1)
|
||||
{
|
||||
SplitString(line_str, '-', pieces);
|
||||
pieces = SplitString(line_str, '-');
|
||||
|
||||
if (pieces.size() == 3 && pieces[0].size() == 4 && pieces[1].size() == 4 &&
|
||||
pieces[2].size() == 5)
|
||||
|
@ -564,8 +564,7 @@ void CCodeView::OnPaint(wxPaintEvent& event)
|
||||
// If running
|
||||
if (m_debugger->IsAlive())
|
||||
{
|
||||
std::vector<std::string> dis;
|
||||
SplitString(m_debugger->Disassemble(address), '\t', dis);
|
||||
std::vector<std::string> dis = SplitString(m_debugger->Disassemble(address), '\t');
|
||||
dis.resize(2);
|
||||
|
||||
static const size_t VALID_BRANCH_LENGTH = 10;
|
||||
|
@ -746,7 +746,6 @@ void CFrame::DoLoadPerspective()
|
||||
void CFrame::LoadIniPerspectives()
|
||||
{
|
||||
m_perspectives.clear();
|
||||
std::vector<std::string> VPerspectives;
|
||||
std::string _Perspectives;
|
||||
|
||||
IniFile ini;
|
||||
@ -755,13 +754,11 @@ void CFrame::LoadIniPerspectives()
|
||||
IniFile::Section* perspectives = ini.GetOrCreateSection("Perspectives");
|
||||
perspectives->Get("Perspectives", &_Perspectives, "Perspective 1");
|
||||
perspectives->Get("Active", &m_active_perspective, 0);
|
||||
SplitString(_Perspectives, ',', VPerspectives);
|
||||
|
||||
for (auto& VPerspective : VPerspectives)
|
||||
for (auto& VPerspective : SplitString(_Perspectives, ','))
|
||||
{
|
||||
SPerspectives Tmp;
|
||||
std::string _Section, _Perspective, _Widths, _Heights;
|
||||
std::vector<std::string> _SWidth, _SHeight;
|
||||
Tmp.name = VPerspective;
|
||||
|
||||
// Don't save a blank perspective
|
||||
@ -783,15 +780,13 @@ void CFrame::LoadIniPerspectives()
|
||||
|
||||
Tmp.perspective = StrToWxStr(_Perspective);
|
||||
|
||||
SplitString(_Widths, ',', _SWidth);
|
||||
SplitString(_Heights, ',', _SHeight);
|
||||
for (auto& Width : _SWidth)
|
||||
for (auto& Width : SplitString(_Widths, ','))
|
||||
{
|
||||
int _Tmp;
|
||||
if (TryParse(Width, &_Tmp))
|
||||
Tmp.width.push_back(_Tmp);
|
||||
}
|
||||
for (auto& Height : _SHeight)
|
||||
for (auto& Height : SplitString(_Heights, ','))
|
||||
{
|
||||
int _Tmp;
|
||||
if (TryParse(Height, &_Tmp))
|
||||
|
Reference in New Issue
Block a user