Raised This Month: $ Target: $400
 0% 

Optimizing Plugins: For Loop Comparisons


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Dygear
SourceMod Donor
Join Date: Apr 2004
Location: Levittown, NY
Old 01-01-2010 , 03:34   Re: Optimizing Plugins: For Loop Comparisons
Reply With Quote #5

Quote:
Originally Posted by fysiks View Post
When strlen() is inside the for() the it is called which is slower than just accessing a value from a variable.
Ok, because I was under the impression that the first statement in the for loop is the initialization line.

Code:
for (initialization; condition; step)     // Code

Code:
for (i = 1; i <= 10; i++)     printf("%d", i);

If what your saying is true, then this will never reach 10, it will just keep on printing out 1s for the rest of time. Does not make much sense to me.
__________________

Last edited by Dygear; 01-01-2010 at 03:36.
Dygear is offline
Send a message via AIM to Dygear Send a message via MSN to Dygear Send a message via Skype™ to Dygear
 



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