Raised This Month: $ Target: $400
 0% 

Rank in a for loop


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
ot_207
Veteran Member
Join Date: Jan 2008
Location: Romania The Love Country
Old 07-15-2010 , 18:21   Re: Rank in a for loop
Reply With Quote #5

Quote:
Originally Posted by grimvh2 View Post
Why? just asking :p
Because it is inefficient.
By adding new to a for loop you basically delete and realloc memory for every cycle.
It is just a use of CPU for something that can be avoided or something useless.
Ex:
PHP Code:
for (new i=0;i<500;i++)
{
  new 
x;

Means:

PHP Code:
// 500 times alloc and reloc
for (new i=0;i<500;i++)
{
  
alloc memory x;
// code
  
delete memory x;

__________________
My approved plug-ins | Good for newbies! | Problems?

Back, will come around when I have time.
ot_207 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 07:10.


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