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.
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
List patterns: subsumption checking #53891
List patterns: subsumption checking #53891
Changes from 71 commits
8ddbf28
3a3f72a
a24334d
52e6be5
e3ce4fb
3625d2f
5a359d0
de4f14a
2beb033
0dfd167
ae7b003
787b93d
fa8a663
81d0e31
91dbb3a
f0adefa
e671bd9
0697233
0bb97b1
e5f1d86
cdcd434
242690f
ebd45ea
8ed4ca8
33ca394
eb44915
11ffabd
d79cb4c
7ca1ed7
ee90c56
dfa6b17
389b9d0
ce9e8c4
c82209c
b1d12cd
635080d
67dc48b
79c8fff
50f4b1d
9f38068
840812a
565a972
a20b47a
18cdab3
8d56fa8
a52aba1
24dcece
04d2de7
5c2625b
c86e44f
c5092df
bebe7b0
8b1cead
2ca2b0c
24f607d
3307706
cf73eab
7c63939
6e109de
ee27875
105f74f
ab253f7
aa99ba2
bfeecd6
418e644
f75e52a
2df2a20
18fcbdb
7c13399
b1d3a08
0e7737b
68a9ab6
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
Large diffs are not rendered by default.
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.
Here and below it looks like this change removed the reference equality optimization.
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.
It's just moved to the base;
Equals
does its own and then calls into the overrides.For direct
IsEquivalent
usages it's not important because it's rather unlikely to have identical nodes where we use it.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.
Because of this change we no longer bypass the following checks when the same instance is compared.
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.
I think this implementation does just that if I'm not mistaken.
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.
I am not sure what implementation you are looking at, I am commenting on this implementation:
I think, the checks after
base.IsEquivalentTo(obj)
are performed for the same instance. Whereas before the change we would bypass all checks.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.
I'm talking about
BoundDagEvaluation.Equals
which is an existing code path with reference check intact.A I said earlier, for direct
IsEquivalentTo
usages (where we indeed don't have a reference check) most of the time we've already determined that the two are not the same instance, e.g.Equals
just returned false.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.
We can just revert the check if you feel it's going to make a visible difference. I have no objection on that.
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.
I prefer that we don't remove optimazation just because we assume that APIs are going to be called in certain order. That doesn't feel like the right approoach in the long term.