1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 17:37:37 +00:00

LibJS: Make StringOrSymbol always be FlyString in the string case

This makes equality checking O(1) instead of O(n).
This commit is contained in:
Andreas Kling 2021-06-13 12:00:27 +02:00
parent cd12b182ca
commit 53a8a11973
2 changed files with 6 additions and 8 deletions

View file

@ -1003,7 +1003,7 @@ int main(int argc, char** argv)
if (key.view().starts_with(property_pattern)) {
Line::CompletionSuggestion completion { key, Line::CompletionSuggestion::ForSearch };
if (!results.contains_slow(completion)) { // hide duplicates
results.append(key);
results.append(String(key));
}
}
}