From f9401529d169d4a91d804de31edf51a8f19095be Mon Sep 17 00:00:00 2001 From: Leon Styhre Date: Sat, 24 Aug 2024 12:50:26 +0200 Subject: [PATCH] Some minor code modernization in MameNames --- es-core/src/MameNames.cpp | 8 ++++---- es-core/src/MameNames.h | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/es-core/src/MameNames.cpp b/es-core/src/MameNames.cpp index 59d611701..d6dbaf0c3 100644 --- a/es-core/src/MameNames.cpp +++ b/es-core/src/MameNames.cpp @@ -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); } } diff --git a/es-core/src/MameNames.h b/es-core/src/MameNames.h index 5aae0fcf0..d683340be 100644 --- a/es-core/src/MameNames.h +++ b/es-core/src/MameNames.h @@ -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