From d8ee6dc106fe9c44fa16337e96a49757e8b00ded Mon Sep 17 00:00:00 2001 From: KiritoDv Date: Fri, 20 Feb 2026 13:49:27 -0600 Subject: Moved last thing c++20 tied --- src/Companion.cpp | 8 ++++---- src/Companion.h | 2 ++ 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/Companion.cpp b/src/Companion.cpp index e7a18d1..08e1ed2 100644 --- a/src/Companion.cpp +++ b/src/Companion.cpp @@ -1622,7 +1622,7 @@ std::string Companion::GetSymbolFromAddr(uint32_t address, bool validZero) { } std::optional Companion::GetParseDataByAddr(uint32_t addr) { - if (this->gParseResults.contains(this->gCurrentFile)) { + if (CONTAINS(this->gParseResults, this->gCurrentFile)) { for (auto& result : this->gParseResults[this->gCurrentFile]) { if (result.data.has_value() && result.GetOffset() == addr) { return result; @@ -1631,7 +1631,7 @@ std::optional Companion::GetParseDataByAddr(uint32_t addr) { } for (auto &file : this->gCurrentExternalFiles) { - if (!this->gParseResults.contains(file)) { + if (!CONTAINS(this->gParseResults, this->gCurrentFile)) { SPDLOG_INFO("GetParseDataByAddr: External File {} Not Found.", file); continue; } @@ -1648,7 +1648,7 @@ std::optional Companion::GetParseDataByAddr(uint32_t addr) { std::optional Companion::GetParseDataBySymbol(const std::string& symbol) { - if (this->gParseResults.contains(this->gCurrentFile)) { + if (CONTAINS(this->gParseResults, this->gCurrentFile)) { for (auto& result : this->gParseResults[this->gCurrentFile]) { auto sym = GetNode(result.node, "symbol"); @@ -1659,7 +1659,7 @@ std::optional Companion::GetParseDataBySymbol(const std::string } for (auto &file : this->gCurrentExternalFiles) { - if (!this->gParseResults.contains(file)) { + if (!CONTAINS(this->gParseResults, this->gCurrentFile)) { SPDLOG_INFO("GetParseDataBySymbol: External File {} Not Found.", file); continue; } diff --git a/src/Companion.h b/src/Companion.h index f35dc45..954f444 100644 --- a/src/Companion.h +++ b/src/Companion.h @@ -14,6 +14,8 @@ #include "utils/Decompressor.h" #include "factories/TextureFactory.h" +#define CONTAINS(_map, value) ((_map).find(value) != (_map).end()) + class BinaryWrapper; namespace fs = std::filesystem; -- cgit v1.2.3