-
Notifications
You must be signed in to change notification settings - Fork 231
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
SE: Caching: Cache "GetHashCode" for SymbolicValue #6968
Merged
pavel-mikula-sonarsource
merged 12 commits into
feature/SE
from
Martin/SE_6964_01_Cache_GetHashcode
Mar 27, 2023
Merged
Changes from 11 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
65d1021
Add cache for SymbolicValue
martin-strecker-sonarsource 49b5c30
Add copy constructor to reset "Lazy"
martin-strecker-sonarsource 59cf2fb
Remove duplicate code
martin-strecker-sonarsource 80c001e
Use nullable int instead on lazy
martin-strecker-sonarsource cbd6fae
Fix implementation
martin-strecker-sonarsource 83d3aae
GetHashCode tests for SymbolicValue
martin-strecker-sonarsource 389b423
Add more cases.
martin-strecker-sonarsource 82134d2
Supress warning
martin-strecker-sonarsource ee16d48
Remove supression
martin-strecker-sonarsource 0a5e74f
Formatting
martin-strecker-sonarsource bd2aa1a
Rename field
martin-strecker-sonarsource f3ef93d
Remove if
martin-strecker-sonarsource File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
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.
This condition is not covered when values are the same. We don't use it that way. And we actually shouldn't, as we should attempt no-operation when possible.
Do we really need the condition then?
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 doesn't hurt to keep it, IMO. It allows doing something like, e.g.
with Constraints = someCond ? Empty : Constraints
. I could add a test case to increase test coverage if that is a concern.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 would remove the condition. It's one more additional
Equals
check on a hot path that doesn't need to be there.And so far, we didn't need it. And it's against the intended usage of the property. We can always add it back if we need to.
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.
That's fine with me.