diff options
| author | KiritoDv <kiritodev01@gmail.com> | 2026-02-20 13:49:27 -0600 |
|---|---|---|
| committer | KiritoDv <kiritodev01@gmail.com> | 2026-02-20 13:49:27 -0600 |
| commit | d8ee6dc106fe9c44fa16337e96a49757e8b00ded (patch) | |
| tree | 360a8aeeacd4a0a267d529eb6edc9dc81b131d71 | |
| parent | a883114d7e6f002a57cca4399fad32b4ed5ffeaa (diff) | |
Moved last thing c++20 tied
| -rw-r--r-- | src/Companion.cpp | 8 | ||||
| -rw-r--r-- | 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<ParseResultData> 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<ParseResultData> 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<ParseResultData> Companion::GetParseDataByAddr(uint32_t addr) { std::optional<ParseResultData> 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<std::string>(result.node, "symbol"); @@ -1659,7 +1659,7 @@ std::optional<ParseResultData> 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; |
