2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-09 17:47:43 +00:00

General: Use emplace_back's return value where applicable

emplace_back() returns a reference to the added element, so we can use
that instead of querying right after the emplacement.
This commit is contained in:
Lioncash
2019-09-05 19:36:40 -04:00
parent 8ff9e028c7
commit fa56ba5db6
4 changed files with 20 additions and 25 deletions

View File

@@ -334,8 +334,7 @@ void FileBrowser::FileListingDataBind::updateListing(const hecl::DirectoryEnumer
m_entries.reserve(dEnum.size());
for (const hecl::DirectoryEnumerator::Entry& d : dEnum) {
m_entries.emplace_back();
Entry& ent = m_entries.back();
Entry& ent = m_entries.emplace_back();
ent.m_path = d.m_path;
hecl::SystemUTF8Conv nameUtf8(d.m_name);
ent.m_name = nameUtf8.str();