-
-
Notifications
You must be signed in to change notification settings - Fork 182
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ToConcreteType Update #751
ToConcreteType Update #751
Conversation
Codecov Report
@@ Coverage Diff @@
## main #751 +/- ##
=======================================
Coverage 64.74% 64.74%
=======================================
Files 226 226
Lines 11464 11459 -5
Branches 2335 2334 -1
=======================================
- Hits 7422 7419 -3
+ Misses 3085 3083 -2
Partials 957 957
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks.
@@ -49,7 +49,7 @@ public DisposeMany(IObservable<IChangeSet<TObject, TKey>> source, Action<TObject | |||
|
|||
private void RegisterForRemoval(IChangeSet<TObject, TKey> changes, Cache<TObject, TKey> cache) | |||
{ | |||
changes.ForEach( | |||
changes.ToConcreteType().ForEach( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I can do a distinct PR for that. I'd like to understand more about why it allocates because that is news to me. As a fan of ForEach
, maybe it can be updated to avoid the allocation instead of needing to be removed.
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Description
This PR continues to effort to replace
IChangeSet<TObject, TKey>
withChangeSet<TObject, TKey>
in order to avoid allocations that can take place when enumerating with the former instead of the latter.ToConcreteType
to throw an exception if a non-ChangeSet implementation of IChangeSet is encounteredToConcreteType
so that it is done withChangeSet
instead.IChangeSet
was completely replaced withChangeSet
in order to ensure more consistent use and reduce the number of places thatToConcreteType
needs to be invoked explicitly