Replace ArrayList/ICollection used for changelog in CollectionView with generic List #9853
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Replaces
ArrayList
used for tracking changes withList<NotifyCollectionChangedEventArgs>
. Instead of usingSyncRoot
(object) of theArrayList
we will just use the newLock
for clarity and slightly improved performance.Also modifies
ProcessChangeLog
/DeferProcessing
fromICollection
toList<NotifyCollectionChangedEventArgs>
for improved performance.ProcessChangeLog
null-check was there because of theas
casting pattern, if theargs
inserted into the_changeLog
would ever be null, it would blow before it was even added inPostChange
(the only proc adding into_changeLog
).DeferProcessing
doesn't need the null-check branch because the only time_changeLog
is written into is always covered using_changeLogLock
, so it cannot be NULL, and the ref transfer to_tempChangeLog
is covered in lock too (ProcessInvoke
).startCount
variable was removed because it was unused.Customer Impact
Improved performance when updating the
CollectionView
, clearer code for developers.Regression
No.
Testing
Local build, testing with CollectionView sample apps, updating from background thread.
Risk
Low.
Microsoft Reviewers: Open in CodeFlow