-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Fix a couple of bugs in SG #55032
Fix a couple of bugs in SG #55032
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,7 +38,7 @@ public NodeStateTable<T> UpdateStateTable(DriverStateTable.Builder graphState, N | |
var inputItems = _getInput(graphState); | ||
|
||
// create a mutable hashset of the new items we can check against | ||
HashSet<T> itemsSet = new HashSet<T>(_comparer); | ||
HashSet<T> itemsSet = new HashSet<T>(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why aren't we using the custom comparer here? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's the bug. Because these are 'input' items (compilations / syntax trees / additional files etc) we control their lifetime. If the user comparer is used they can say that two additional files are different when they are not; that breaks our internal assumptions around comparers that they can only be used to change a modified value back to a cached value. Basically the only time the comparer should be used is if we think the item has changed, the user has to the ability to override it. |
||
foreach (var item in inputItems) | ||
{ | ||
var added = itemsSet.Add(item); | ||
|
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.