diff --git a/media-layer/core/src/audio/file.cpp b/media-layer/core/src/audio/file.cpp index 09925482e1..9cdb9ed1f0 100644 --- a/media-layer/core/src/audio/file.cpp +++ b/media-layer/core/src/audio/file.cpp @@ -14,11 +14,11 @@ // Load Symbol From ELF File static void load_symbol(const char *source, const char *name, std::function callback) { static std::unordered_map> sources = {}; - auto pos = sources.find(std::string(source)); - if (pos == sources.end()) { - sources[std::string(source)] = LIEF::ELF::Parser::parse(source); + std::string cpp_source = source; + if (sources.count(cpp_source) == 0) { + sources[cpp_source] = LIEF::ELF::Parser::parse(source); } - std::unique_ptr &binary = sources[std::string(source)]; + std::unique_ptr &binary = sources[cpp_source]; const LIEF::ELF::Symbol *symbol = binary->get_dynamic_symbol(name); if (symbol != NULL) { LIEF::span data = binary->get_content_from_virtual_address(symbol->value(), symbol->size(), LIEF::Binary::VA_TYPES::VA);