diff options
author | AnotherTest <ali.mpfard@gmail.com> | 2020-05-22 05:43:22 +0430 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-05-23 01:31:41 +0200 |
commit | 0446b7e347f20062f8a560c51bee7cf8182a6a7c (patch) | |
tree | cbd61b0f4bdc2a36fda7c58adaec6f4fba47eaf1 /Userland | |
parent | 2427f3b38ba65948a63c61e121733bdf060851ea (diff) | |
download | serenity-0446b7e347f20062f8a560c51bee7cf8182a6a7c.zip |
Userland/js: Do not construct a full CompletionSuggestion just to compare against
Diffstat (limited to 'Userland')
-rw-r--r-- | Userland/js.cpp | 4 |
1 files 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<void(const JS::Shape&, const StringView&)> 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 }); } } } |