Skip to content

Commit

Permalink
UPDATED: System.Linq.cs, DmjrsLinqExtensions
Browse files Browse the repository at this point in the history
- Commented out a block of code that removes a range of items from a collection
- Updated the code to use a lambda expression instead of a foreach loop to remove items
  • Loading branch information
dgmjr committed Mar 2, 2024
1 parent 893e806 commit c8ca620
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions System/System.Linq/System.Linq.cs
Original file line number Diff line number Diff line change
Expand Up @@ -97,14 +97,14 @@ IEnumerable<T> removeRange
{
if (removeRange != null)
{
if (collection is IList<T> list)
{
list.RemoveRange(removeRange);
}
else
{
// if (collection is List<T> list)
// {
// list.RemoveRange(removeRange);
// }
// else
// {
removeRange.ForEach(item => collection.Remove(item));
}
// }
}
return collection;
}
Expand Down

0 comments on commit c8ca620

Please sign in to comment.