Begin Equals on records with check for equality #4411
Unanswered
Xenoage
asked this question in
Language Ideas
Replies: 2 comments 2 replies
-
Honestly, kind of surprised it doesn't do this already. |
Beta Was this translation helpful? Give feedback.
0 replies
-
We had an internal thread based on benchmarks that @PathogenDavid collected here #39 (comment), and had decided to change the implementation. We apparently forgot to follow up on that desire. I'll bring it up with the team and see if we change the behavior in 16.10. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Currently, the auto-generated
Equals
method for records look like this:Since
record
s will be used a lot for immutable data structures, which encourages to reuse and share objects, it would be very helpful to check for reference equality first. In this case, theEquals
method would be speeded up enormously, especially for large object trees. Like this:What do you think?
Beta Was this translation helpful? Give feedback.
All reactions