Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
\$\begingroup\$Welcome to Code Review. Please see How do I ask a good question? While not necessarily off-topic, your question's scope is so limited (1 single expression) that there is only very little we can actually review.\$\endgroup\$
\$\begingroup\$Being too short has never been a reason to close. If you think there's no useful advice you can note that, but the question is not off topic.\$\endgroup\$
\$\begingroup\$I'm voting to close this question as off-topic because you're not looking for a code review and just an alternative solution on a black-box level ("gimme the better codes").\$\endgroup\$
\$\begingroup\$@Pimgd I'm not convinced that it is off-topic. The question is basically asking "How can I do it faster?" The answer is, essentially, "Your code is fine."\$\endgroup\$
\$\begingroup\$@200_success OP would not be helped by a review talking about that poor variable naming, what is y supposed to mean? They're looking for an alternative code snippet that will replace this one.\$\endgroup\$
ysupposed to mean? They're looking for an alternative code snippet that will replace this one. \$\endgroup\$