From 0446b7e347f20062f8a560c51bee7cf8182a6a7c Mon Sep 17 00:00:00 2001 From: AnotherTest Date: Fri, 22 May 2020 05:43:22 +0430 Subject: [PATCH] Userland/js: Do not construct a full CompletionSuggestion just to compare against --- Userland/js.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Userland/js.cpp b/Userland/js.cpp index 4c6fbe080b..e43b210c9f 100644 --- a/Userland/js.cpp +++ b/Userland/js.cpp @@ -729,9 +729,9 @@ int main(int argc, char** argv) Function list_all_properties = [&results, &list_all_properties](const JS::Shape& shape, auto& property_pattern) { for (const auto& descriptor : shape.property_table()) { if (descriptor.key.view().starts_with(property_pattern)) { - Line::CompletionSuggestion completion { descriptor.key }; + Line::CompletionSuggestion completion { descriptor.key, Line::CompletionSuggestion::ForSearch }; if (!results.contains_slow(completion)) { // hide duplicates - results.append(completion); + results.append({ descriptor.key }); } } }