c# - Are these enumerations code functionally the same? -
foreach ( effect effect in this.effects.where ( e => e.istransparenteffect && e.hasgpusupport ) ) yield return new realtimeeffect<transparenteffect> ( effect );
vs
this.effects.where ( e => e.istransparenteffect && e.hasgpusupport ) .select ( e => new realtimeeffect<transparenteffect> ( e ) );
i somehow think select try gather results differently yielding in #1?
also there performance difference?
both codes return same results. both have deferred execution (i.e. nothing executed until start enumerating result) , stream results (i.e. not buffered). there shouldn't significant performance difference between 2 versions
Comments
Post a Comment