Raised This Month: $ Target: $400
 0% 

Is here any diff in these lines?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
9evill
Senior Member
Join Date: Apr 2007
Location: Lithuania
Old 08-04-2010 , 06:45   Re: Is here any diff in these lines?
Reply With Quote #1

So in both examples plugin will use same ammount of calls?

my thoughts about these in case of dead user:
in first example plugin check if user alive and if not returns - one call (zombie check not called)
in second example plugin check if user alive or is not zombie - two calls. Or plugin returns just after if_user_alive check?
9evill is offline
Seta00
The Seta00 user has crashed.
Join Date: Jan 2010
Location: Berlin
Old 08-04-2010 , 07:12   Re: Is here any diff in these lines?
Reply With Quote #2

Quote:
Originally Posted by 9evill View Post
Or plugin returns just after if_user_alive check?
It doesn't. Using two ifs is faster but pointless, as the speed difference will be insignificant.

On the other side, in this code:
Code:
if (!is_user_alive(id) && !zp_get_user_zombie(id))
If the first check (is_user_alive) fails, the other one never gets executed.

Last edited by Seta00; 08-04-2010 at 08:54.
Seta00 is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 00:12.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode