Reputation: 330912
var effects = this.EffectsRecursive;
foreach ( Effect effect in effects )
{
...
}
vs
foreach ( Effect effect in this.EffectsRecursive )
{
...
}
Upvotes: 2
Views: 102
Reputation: 77546
No, the foreach operates on the result of the call to IEnumerable.GetEnumerator
, which will get called only once either way.
Upvotes: 10