cathei / LinqGen

Alloc-free and fast replacement for Linq, with code generation

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add Foreach() method

FredTunaB opened this issue · comments

Would it be possible to add a ForEach method for LinqGen.

For example to be able to do:
list.Gen().Where(/*predicate*/).ForEach(/*do something*/)

instead of

foreach (Type x in list.Gen().Where(/*predicate*/)) //Do Something

Hello, thank you for trying LinqGen. ForEach is not supported since it does not have any benefit over using foreach statement. Using ForEach implies using lambda- essentially cancelling out benefits of LinqGen (Being allocation free and specialized).