mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 06:37:43 +00:00
Userland/js: Do not construct a full CompletionSuggestion just to compare against
This commit is contained in:
parent
2427f3b38b
commit
0446b7e347
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