Raised This Month: $ Target: $400
 0% 

Optimizing Plugins: For Loop Comparisons


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 01-01-2010 , 01:00   Re: Optimizing Plugins: For Loop Comparisons
Reply With Quote #4

Quote:
Originally Posted by Dygear View Post
Isn't it the same as doing this?

Code:
new string[256] = "something long, that's what she said."; new i = 0, len = strlen(string); for (; i < len; i++)     //...code

Just wondering if it's different in PAWN then the other languages I use.
No, it's not the same. strlen() in that code is not inside the for() so it is not called every iteration. When strlen() is inside the for() the it is called which is slower than just accessing a value from a variable.
__________________
fysiks 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 04:06.


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