Talk:Loop-invariant code motion: Difference between revisions

Content deleted Content added
Themania (talk | contribs)
Really not a problem.
Line 36:
 
This sort of optimization is frequently seen in JavaScript, where iterating over an array or a list of DOM nodes can often be sped up by precalculating the length of the array or node list either outside the loop or (more commonly) in the initialization of the loop variables (e.g., <code>for(var i=0, max=someList.length; i < max; i++)</code> instead of <code>for(var i=0; i<someList.length; i++)</code>, avoiding the repetitive computation -- in some JavaScript implementations -- of <code>someList.length</code>). If anyone thinks this would be a useful addition to the article, I'll dig up some references and put it in. [[User:Ubernostrum|Ubernostrum]] 08:43, 5 July 2007 (UTC)
 
== Somethign wrong here in the example ==
 
There is no need for this loop at all. Just multiply the sodding thing up by calcval and then round off the end. Something is wrong here.
 
[[User:SimonTrew|SimonTrew]] ([[User talk:SimonTrew|talk]]) 21:56, 9 March 2009 (UTC)