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

Popular posts from this blog

python - Scipy curvefit RuntimeError:Optimal parameters not found: Number of calls to function has reached maxfev = 1000 -

c# - How to add a new treeview at the selected node? -

java - netbeans "Please wait - classpath scanning in progress..." -