Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Basic C# question
Message
From
06/07/2006 04:31:26
 
 
To
05/07/2006 13:42:17
General information
Forum:
ASP.NET
Category:
Other
Environment versions
Environment:
C# 2.0
Miscellaneous
Thread ID:
01133939
Message ID:
01134059
Views:
28
Alex,

It is recommended that you leave the count in the body of the loop as the JIT compiler looks for this pattern and knows how to optimize it (hoisting).
for (int i = 0; i < this.TreeView1.Nodes.Count; i++)
{
}
If you perform the hoisting yourself you remove this ability away from the optimising compiler.

Regards
Neil
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform