Raised This Month: $ Target: $400
 0% 

Optimizing Plugins: For Loop Comparisons


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Dygear
SourceMod Donor
Join Date: Apr 2004
Location: Levittown, NY
Old 12-31-2009 , 19:26   Optimizing Plugins: For Loop Comparisons
Reply With Quote #1

Optimizing Plugins (AMX Mod X Scripting): For Loop Comparisons

Code:
new string[256] = "something long" for (new i=0; i<strlen(string); i++)    //...code

Agreed that is bad, but this:

Code:
new string[256] = "something long" new len = strlen(string) for (new i=0; i<len; i++)    //...code

Why not:

Code:
new string[256] = "something long" for (new i = 0, len = strlen(string); i < len; i++)    //...code
__________________

Last edited by Dygear; 12-31-2009 at 19:31.
Dygear is offline
Send a message via AIM to Dygear Send a message via MSN to Dygear Send a message via Skype™ to Dygear
 


Thread Tools
Display Modes

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 04:06.


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