utm_form icon indicating copy to clipboard operation
utm_form copied to clipboard

Use of while loop for condition evaluation

Open gioamato opened this issue 5 years ago • 2 comments

https://github.com/medius/utm_form/blob/d7165cb254243ddcac155c559e280760ac431843/lib/utm_cookie.coffee#L56-L57

Should we use if instead?

gioamato avatar Feb 18 '20 12:02 gioamato

Not sure about if statement, but there are other approaches that might be simpler. e.g. https://stackoverflow.com/questions/10730362/get-cookie-by-name

But to be honest, unless something is breaking, it might be better to keep this code as is. Not sure how much advantage there is by changing this part.

medius avatar Feb 19 '20 02:02 medius

No problem. I just wanted to suggest a more efficient and elegant solution than using a loop for an evaluation.

gioamato avatar Feb 19 '20 11:02 gioamato