Skip to content

Comments

refactor(textinput): reduce allocations#413

Merged
maaslalani merged 1 commit intocharmbracelet:masterfrom
naglis:textinput-reduce-alloc
Jan 8, 2024
Merged

refactor(textinput): reduce allocations#413
maaslalani merged 1 commit intocharmbracelet:masterfrom
naglis:textinput-reduce-alloc

Conversation

@naglis
Copy link
Contributor

@naglis naglis commented Aug 30, 2023

As the number of items in suggestions and m.suggestions is known, we can use make with the expected size instead of appending, which requires more allocations as the slice grows.

As the number of items in `suggestions` and `m.suggestions` is known,
we can use `make` with the expected size instead of appending, which
requires more allocations as the slice grows.
@maaslalani
Copy link
Contributor

Thanks so much for the PR @naglis, very much appreciated ❤️

@maaslalani maaslalani merged commit ec88302 into charmbracelet:master Jan 8, 2024
youyoumu pushed a commit to youyoumu/bubbles that referenced this pull request Jan 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants