Optimizing code by understanding usage

added by DotNetKicks
3/9/2022 6:07:01 PM

200 Views

During code review, I run into the following code (simplified): We have some wrapper object for IEnumerable and allow to access it by index. I don't like this code, and suggested this version, instead: The problem is that if you'll look at the code of ElementAt(), it is already doing that, so why the duplicate work?


0 comments