Little optimization
Is there anyway that i can do this in just one line? I've been trying all different things but i can't seem to get it to work.
PHP Code:
This is something i'd use, but the last part "DO NOTHING" needs to be changed since it makes no sense PHP Code:
|
Re: Little optimization
your example in 'else' got me thinking of:
Code:
(get_pcvar_num(pSounds) ? client_cmd(iAttacker, "mp3 play %s", szSound)) |
Re: Little optimization
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. |
Re: Little optimization
Quote:
|
| All times are GMT -4. The time now is 02:42. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.