Monday, May 3, 2004

Enumerating array using for vs. foreach

Enumerating array using for vs. foreach

Here's an interesting tidbit over on Brad Abram's blog about the difference between for and foreach when iterating over an array. Apparently the C# compiler just code-gens an equivalent for statement when using foreach on an array. Something we'll need to keep in mind when/if foreach makes it into a "future" release of Delphi for .NET.

No comments:

Post a Comment

Please keep your comments related to the post on which you are commenting. No spam, personal attacks, or general nastiness. I will be watching and will delete comments I find irrelevant, offensive and unnecessary.