Beispiel #1
0
        private IChangeSet <T> Process(ChangeAwareList <T> target, IChangeSet <T> changes)
        {
            // if all removes and not Clear, then more efficient to try clear range
            if (changes.TotalChanges == changes.Removes && changes.All(c => c.Reason != ListChangeReason.Clear) && changes.Removes > 1)
            {
                var removed = changes.Unified().Select(u => u.Current);
                target.RemoveMany(removed);
                return(target.CaptureChanges());
            }

            return(ProcessImpl(target, changes));
        }