gleam-lang/gleam

Avoid calling `bitArraySliceToFloat` in generated JS for float patterns

Open

#4658 opened on Jun 2, 2025

View on GitHub
 (2 comments) (0 reactions) (0 assignees)Rust (21,417 stars) (960 forks)batch import
help wanted

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.

Contributor guide