Raised This Month: $ Target: $400
 0% 

Optimizing code.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
joaquimandrade
Veteran Member
Join Date: Dec 2008
Location: Portugal
Old 04-10-2009 , 13:52   Re: Optimizing code.
Reply With Quote #1

What you want this to do:
PHP Code:
    if( !gButtons[START] ) 
                for( 
0sizeof szCounterStarti++ ) 
                    if( 
equalszTargetszCounterStart[i] ) ) 
                        
gButtons[START] = iEntity
?

Find the first (equal( szTarget, szCounterStart[i]) or the last one? As you have it its finding the last one. If it can be the first, add a break. If you want the last one change the for to
PHP Code:
for( sizeof szCounterStart ->= i-- ) 
and add a break.

If you explain it more i can optimize it.
__________________
joaquimandrade 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 02:19.


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