diff options
author | Ben Wiederhake <BenWiederhake.GitHub@gmx.de> | 2021-12-05 12:10:17 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2022-01-01 15:40:39 +0100 |
commit | 8b8cd184822a1ac98d09ac587368cb515f2a85ff (patch) | |
tree | 68b52e5daa786ee60158a1b728fed23a86aaff5d /Userland/DevTools | |
parent | 95c21977b4cad7d87c03f534a224916a78bfeba1 (diff) | |
download | serenity-8b8cd184822a1ac98d09ac587368cb515f2a85ff.zip |
HackStudio: Avoid unnecessary copies in CodeComprehensionEngine
Diffstat (limited to 'Userland/DevTools')
-rw-r--r-- | Userland/DevTools/HackStudio/LanguageServers/CodeComprehensionEngine.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Userland/DevTools/HackStudio/LanguageServers/CodeComprehensionEngine.cpp b/Userland/DevTools/HackStudio/LanguageServers/CodeComprehensionEngine.cpp index 37093fc2ab..361ffd392d 100644 --- a/Userland/DevTools/HackStudio/LanguageServers/CodeComprehensionEngine.cpp +++ b/Userland/DevTools/HackStudio/LanguageServers/CodeComprehensionEngine.cpp @@ -24,8 +24,8 @@ void CodeComprehensionEngine::set_declarations_of_document(const String& filenam return; // Optimization - Only notify callback if declarations have changed - if (auto previous_declarations = m_all_declarations.get(filename); previous_declarations.has_value()) { - if (previous_declarations.value() == declarations) + if (auto previous_declarations = m_all_declarations.find(filename); previous_declarations != m_all_declarations.end()) { + if (previous_declarations->value == declarations) return; } if (m_store_all_declarations) |