The previous PR actually only fixed 2 of the 4 warnings in rollup. Somehow the REPL online is not reporting them (as you can see from the links in that comment earlier) although I am using the same 4.18.1 rollup version locally.
So apologies for the second PR in a row, the repl wasn't enough 😕 But I have tested with a real use case now.
Here I have extracted the two sqrt calls into const which has two benefits:
performance/size: saves a few bytes when tested with terser (when using noise 2D and noise 4D, noise 3D is not using the sqrts' so nothing more is eliminated)
The previous PR actually only fixed 2 of the 4 warnings in rollup. Somehow the REPL online is not reporting them (as you can see from the links in that comment earlier) although I am using the same 4.18.1 rollup version locally. So apologies for the second PR in a row, the repl wasn't enough 😕 But I have tested with a real use case now.
Here I have extracted the two sqrt calls into const which has two benefits: