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:
hanaa12G 2023-12-07 03:49:35 +07:00 committed by Ali Mohammad Pur
commit 19f137c1e6
Notes: sideshowbarker 2024-07-17 11:29:41 +09:00
7 changed files with 54 additions and 66 deletions

View file

@ -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;
}