gleam-lang/gleam

Avoid calling `bitArraySliceToFloat` in generated JS for float patterns

Open

#4658 aperta il 2 giu 2025

Vedi su GitHub
 (2 commenti) (0 reazioni) (0 assegnatari)Rust (960 fork)batch import
help wanted

Metriche repository

Star
 (21.417 star)
Metriche merge PR
 (Merge medio 10g 19h) (69 PR mergiate in 30 g)

Descrizione

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.

Guida contributor