Raised This Month: $ Target: $400
 0% 

Another efficiency questoin


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Liverwiz
Veteran Member
Join Date: Feb 2010
Location: Maryland
Old 08-08-2012 , 19:06   Another efficiency questoin
Reply With Quote #1

This is probably silly. But which is faster. Checking, then setting if it needs to be. Or just setting the value to what it needs to be. See following code examples.

PHP Code:
for(new 1<= g_maxClientsi++)
        
blockList[i][id] = false    // Unblock the client, if left blocked 
or

PHP Code:
or(new 1<= g_maxClientsi++)
{
    if(
blockList[i][id])
        
blockList[i][id] = false    // Unblock the client, if left blocked

My guess is the first, but i'm also curious to know for sure.
It should also be noted that it is most likely to be false anyway.
__________________
What an elegant solution to a problem that doesn't need solving....
Liverwiz is offline
 



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 05:51.


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