Created
September 24, 2012 22:29
-
-
Save ferventcoder/3778846 to your computer and use it in GitHub Desktop.
How to Remove Items from A List ?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
foreach (var item in items.ToList()) | |
{ | |
items.Remove(item); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
as we discussed on twitter, this has potential worst case runtime of O(n*m) = O(n^2) instead of the pastie that has a worst case runtime of O(2n) = O(n) :)