1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 11:48:10 +00:00

HackStudio: Avoid unnecessary copies in CodeComprehensionEngine

This commit is contained in:
Ben Wiederhake 2021-12-05 12:10:17 +01:00 committed by Andreas Kling
parent 95c21977b4
commit 8b8cd18482

View file

@ -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)