Thread: [Solved] Little optimization
View Single Post
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 01-22-2020 , 11:41   Re: Little optimization
Reply With Quote #4

Quote:
Originally Posted by HamletEagle View Post
Why in the world you want an one line solution?
How in the world would that be an optimization? Less lines has nothing to do with how fast the code is. You should try to write clear and readable code, not short code. Short code is not a goal, if the plugin ends up short that's cool, if it doesn't then it's perfectly fine.
Funny enough both the if check and the ternary operator would likely be translated to the same assembly instructions by the compiler.

Don't waste your time trying to fix something that's not broken.
Okay thanks
__________________
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be