Get previous and next item in a IEnumerable using LINQ
First off “Better” includes a combination of performance (memory and speed) In general you can’t have both, the rule of thumb is, if you optimise for speed, it’ll cost memory, if you optimise for memory, it’ll cost you speed. There is a better option, that performs well on both memory and speed fronts, and can … Read more