gleam-lang/gleam
View on GitHubAvoid calling `bitArraySliceToFloat` in generated JS for float patterns
Open
#4,658 opened on Jun 2, 2025
help wanted
Repository metrics
- Stars
- (21,417 stars)
- PR merge metrics
- (Avg merge 10d 19h) (69 merged PRs in 30d)
Description
Today when using a :float bit array pattern the bitArraySliceToFloat function is called twice with the same arguments. This is wasted work!
Change the code generator to do it only once, saving the result to a variable to use twice.