mirror of
https://git.h3cjp.net/H3cJP/citra.git
synced 2024-11-28 06:52:47 +00:00
lm: Make use of insert_or_assign() in Log()
Avoids unnecessary default construction of an entry in cases where no entry exists before overwriting the created entry.
This commit is contained in:
parent
5ba49f188b
commit
29cd40bded
|
@ -105,7 +105,7 @@ private:
|
||||||
if (True(header.flags & LogPacketFlags::Head)) {
|
if (True(header.flags & LogPacketFlags::Head)) {
|
||||||
std::vector<u8> tmp(data.size() - sizeof(LogPacketHeader));
|
std::vector<u8> tmp(data.size() - sizeof(LogPacketHeader));
|
||||||
std::memcpy(tmp.data(), data.data() + offset, tmp.size());
|
std::memcpy(tmp.data(), data.data() + offset, tmp.size());
|
||||||
entries[entry] = std::move(tmp);
|
entries.insert_or_assign(entry, std::move(tmp));
|
||||||
} else {
|
} else {
|
||||||
const auto entry_iter = entries.find(entry);
|
const auto entry_iter = entries.find(entry);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue