Some minor code modernization in MameNames

This commit is contained in:
Leon Styhre 2024-08-24 12:50:26 +02:00
parent 068b7c6bfd
commit f9401529d1
2 changed files with 5 additions and 5 deletions

View file

@ -48,7 +48,7 @@ MameNames::MameNames()
return;
}
for (pugi::xml_node gameNode = doc.child("game"); gameNode;
for (pugi::xml_node gameNode {doc.child("game")}; gameNode;
gameNode = gameNode.next_sibling("game")) {
mNamePairs[gameNode.child("mamename").text().get()] =
gameNode.child("realname").text().get();
@ -75,7 +75,7 @@ MameNames::MameNames()
return;
}
for (pugi::xml_node biosNode = doc.child("bios"); biosNode;
for (pugi::xml_node biosNode {doc.child("bios")}; biosNode;
biosNode = biosNode.next_sibling("bios")) {
std::string bios = biosNode.text().get();
mMameBioses.emplace_back(bios);
@ -102,9 +102,9 @@ MameNames::MameNames()
return;
}
for (pugi::xml_node deviceNode = doc.child("device"); deviceNode;
for (pugi::xml_node deviceNode {doc.child("device")}; deviceNode;
deviceNode = deviceNode.next_sibling("device")) {
std::string device = deviceNode.text().get();
std::string device {deviceNode.text().get()};
mMameDevices.emplace_back(device);
}
}

View file

@ -27,7 +27,7 @@ public:
std::string getRealName(const std::string& mameName)
{
std::string name = mNamePairs[mameName];
std::string name {mNamePairs[mameName]};
if (name == "")
return mameName;
else