mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-05-01 21:52:41 +02:00
GeckoCodeConfig: Use compare instead of substr for comparing substrings
Gets rid of an unnecessary string construction.
This commit is contained in:
parent
0d0e9f626d
commit
2f52d04e30
@ -79,14 +79,15 @@ std::vector<GeckoCode> LoadCodes(const IniFile& globalIni, const IniFile& localI
|
|||||||
|
|
||||||
for (const std::string& line : lines)
|
for (const std::string& line : lines)
|
||||||
{
|
{
|
||||||
if (line.size() == 0 || line[0] != '$')
|
if (line.empty() || line[0] != '$')
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
std::string name = line.substr(1);
|
|
||||||
for (GeckoCode& ogcode : gcodes)
|
for (GeckoCode& ogcode : gcodes)
|
||||||
{
|
{
|
||||||
if (ogcode.name == name)
|
// Exclude the initial '$' from the comparison.
|
||||||
|
if (line.compare(1, std::string::npos, ogcode.name) == 0)
|
||||||
{
|
{
|
||||||
ogcode.enabled = true;
|
ogcode.enabled = true;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user