KilledByAPixel / ZzFX

A Tiny JavaScript Sound FX System
https://zzfx.3d2k.com
MIT License
584 stars 37 forks source link

Use `Math.sign` instead of own implementation #5

Closed joseprio closed 3 years ago

joseprio commented 3 years ago

Noticed that both ZzFX and ZzFXMicro implement a sign function. In the context where this is used, it can be replaced with Math.sign, which has fairly good browser support.

Happy to provide a PR.

joseprio commented 3 years ago

After checking, looks like this is already optimized, probably by inlining.