mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-01-06 11:09:05 +03:00
Userland/js: Do not construct a full CompletionSuggestion just to compare against
This commit is contained in:
parent
2427f3b38b
commit
0446b7e347
Notes:
sideshowbarker
2024-07-19 06:14:01 +09:00
Author: https://github.com/alimpfard Commit: https://github.com/SerenityOS/serenity/commit/0446b7e347f Pull-request: https://github.com/SerenityOS/serenity/pull/2320 Reviewed-by: https://github.com/awesomekling Reviewed-by: https://github.com/bugaevc
@ -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 });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user