mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-02 14:19:48 +00: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: 0446b7e347
Pull-request: https://github.com/SerenityOS/serenity/pull/2320
Reviewed-by: https://github.com/awesomekling
Reviewed-by: https://github.com/bugaevc
1 changed files with 2 additions and 2 deletions
|
@ -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) {
|
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()) {
|
for (const auto& descriptor : shape.property_table()) {
|
||||||
if (descriptor.key.view().starts_with(property_pattern)) {
|
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
|
if (!results.contains_slow(completion)) { // hide duplicates
|
||||||
results.append(completion);
|
results.append({ descriptor.key });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue