Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions src/Caliburn.Micro.Core/BindableCollection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using System.Collections.ObjectModel;
using System.Collections.Specialized;
using System.ComponentModel;

using System.Linq;
namespace Caliburn.Micro
{
/// <summary>
Expand Down Expand Up @@ -250,14 +250,13 @@
{
var previousNotificationSetting = IsNotifying;
IsNotifying = false;
foreach (var item in items)
foreach (var index in items.Select(item => IndexOf(item)))
{
var index = IndexOf(item);
if (index >= 0)
{
RemoveItemBase(index);
}
}

Check notice

Code scanning / CodeQL

Missed opportunity to use Where Note

This foreach loop
implicitly filters its target sequence
- consider filtering the sequence explicitly using '.Where(...)'.
IsNotifying = previousNotificationSetting;

OnPropertyChanged(new PropertyChangedEventArgs("Count"));
Expand Down
Loading