Skip to content
This repository was archived by the owner on Sep 21, 2021. It is now read-only.

Solves unnecessarily iterating list twice #5

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

onuar
Copy link

@onuar onuar commented Sep 27, 2020

var trueResult = list.Where(i => ifStatement(i));
var falseResult = list.Where(i => !ifStatement(i));

It might cause some performance issue. With this PR, it will be O(n).

Sorry for the inconvenience. I was so sleepy when I wrote old one.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant