mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-29 04:37:55 +00:00
LibLine: Remove duplicate members in CompletionSuggestion
Previously, we stored two representations of the same string in `CompletionSuggestion` object: one for the bytes and the other for the code points corresponding to those bytes. To minimize duplication, this patch combine both representations into a single UTF-8 string, which is already supported by our new String class. Following this update, we successfully reduce the size of each object from 376 bytes to 256 bytes
This commit is contained in:
committed by
Ali Mohammad Pur
parent
89877b3f40
commit
19f137c1e6
@@ -150,7 +150,7 @@ Vector<CodeComprehension::AutocompleteResultEntry> ShellComprehensionEngine::get
|
||||
auto completions = const_cast<::Shell::AST::Node*>(document.node.ptr())->complete_for_editor(shell(), offset_in_file, hit_test).release_value_but_fixme_should_propagate_errors();
|
||||
Vector<CodeComprehension::AutocompleteResultEntry> entries;
|
||||
for (auto& completion : completions)
|
||||
entries.append({ completion.text_string, completion.input_offset });
|
||||
entries.append({ completion.text_string(), completion.input_offset });
|
||||
|
||||
return entries;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user