summaryrefslogtreecommitdiffstats
path: root/src/core
diff options
context:
space:
mode:
authorLioncash <mathew1800@gmail.com>2021-04-23 15:24:19 +0200
committerLioncash <mathew1800@gmail.com>2021-04-23 15:24:21 +0200
commit5ba49f188bf39cdfc71a6b78d7d846b4b0725dc3 (patch)
tree39e6a9f9e0310bd98c24a739b9ad0bb757c9637b /src/core
parentlm: Resolve -Wextra-semi warning (diff)
downloadyuzu-5ba49f188bf39cdfc71a6b78d7d846b4b0725dc3.tar
yuzu-5ba49f188bf39cdfc71a6b78d7d846b4b0725dc3.tar.gz
yuzu-5ba49f188bf39cdfc71a6b78d7d846b4b0725dc3.tar.bz2
yuzu-5ba49f188bf39cdfc71a6b78d7d846b4b0725dc3.tar.lz
yuzu-5ba49f188bf39cdfc71a6b78d7d846b4b0725dc3.tar.xz
yuzu-5ba49f188bf39cdfc71a6b78d7d846b4b0725dc3.tar.zst
yuzu-5ba49f188bf39cdfc71a6b78d7d846b4b0725dc3.zip
Diffstat (limited to 'src/core')
-rw-r--r--src/core/hle/service/lm/lm.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/core/hle/service/lm/lm.cpp b/src/core/hle/service/lm/lm.cpp
index 70f5272af..b311ad300 100644
--- a/src/core/hle/service/lm/lm.cpp
+++ b/src/core/hle/service/lm/lm.cpp
@@ -95,7 +95,7 @@ private:
std::memcpy(&header, data.data(), sizeof(LogPacketHeader));
offset += sizeof(LogPacketHeader);
- LogPacketHeaderEntry entry{
+ const LogPacketHeaderEntry entry{
.pid = header.pid,
.tid = header.tid,
.severity = header.severity,
@@ -107,14 +107,15 @@ private:
std::memcpy(tmp.data(), data.data() + offset, tmp.size());
entries[entry] = std::move(tmp);
} else {
+ const auto entry_iter = entries.find(entry);
+
// Append to existing entry
- if (!entries.contains(entry)) {
+ if (entry_iter == entries.cend()) {
LOG_ERROR(Service_LM, "Log entry does not exist!");
return;
}
- std::vector<u8> tmp(data.size() - sizeof(LogPacketHeader));
- auto& existing_entry = entries[entry];
+ auto& existing_entry = entry_iter->second;
const auto base = existing_entry.size();
existing_entry.resize(base + (data.size() - sizeof(LogPacketHeader)));
std::memcpy(existing_entry.data() + base, data.data() + offset,