text_input: add comment about ArrayList not being ideal

Siged-off-by: Tim Culverhouse <tim@timculverhouse.com>
This commit is contained in:
Tim Culverhouse 2024-01-22 20:14:15 -06:00
parent d2f02897dc
commit fd97fff931

View file

@ -18,6 +18,9 @@ const Event = union(enum) {
cursor_idx: usize = 0, cursor_idx: usize = 0,
grapheme_count: usize = 0, grapheme_count: usize = 0,
// TODO: an ArrayList is not great for this. orderedRemove is O(n) and we can
// only remove one byte at a time. Make a bespoke ArrayList which allows removal
// of a slice at a time, or truncating even would be nice
buf: std.ArrayList(u8), buf: std.ArrayList(u8),
pub fn init(alloc: std.mem.Allocator) TextInput { pub fn init(alloc: std.mem.Allocator) TextInput {