score:2

Accepted answer

The two code snippets are equivalent, i.e. they should always produce the same results under all circumstances. Of course, that assumes that AgendaSessions, Tracks and .Contains() are what we expect them to be; if they are property getters/methods which have curious side-effects such as modifying the contents of tracks, then anything could happen.

In other words, without knowing what the rest of your code looks like, we cannot help you, because there is no semantic difference between the two code snippets.


Related Articles