-
Notifications
You must be signed in to change notification settings - Fork 6k
Conversation
It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact Hixie on the #hackers channel in Chat. If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix? Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. |
56f04c4
to
23220a6
Compare
hashValues
and hashList
hashValues
and hashList
23220a6
to
c2913f9
Compare
hashValues
and hashList
hashValues
and hashList
lib/ui/hash_codes.dart
Outdated
result = _Jenkins.combine(result, arg19); | ||
if (!identical(arg20, _hashEnd)) { | ||
result = _Jenkins.combine(result, arg20); | ||
// I can see my house from here! |
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 sad that my joke is going away :-(
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.
Sorry to take that away 😢 . I loved it btw! Made me laugh IRL.
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.
Your joke lives on 🖖🏾
lib/web_ui/test/hash_codes_test.dart
Outdated
@@ -1,127 +0,0 @@ | |||
// Copyright 2013 The Flutter Authors. All rights reserved. |
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 keep this file (with suitable //ignore
s for the deprecation warnings and with the numbers adjusted as necessary). That will act as an effective test that the deprecated API still works.
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.
What problem motivated this test?
It seems very specific to some issue.
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.
cc @yjbanov
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.
Restored the test.
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 would be worth validating performance after this change.
- Are there any regressions in code that predominantly uses the changes to
Object.hash
- Are there any regressions in unmigrated code that still uses
hashValues
?
lib/ui/hash_codes.dart
Outdated
// Borrowed from the dart sdk: sdk/lib/math/jenkins_smi_hash.dart. | ||
class _Jenkins { | ||
static int combine(int hash, Object? o) { | ||
assert(o is! Iterable); |
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.
How important is this assertion?
Object.hash
has no similar assertion, and never will, since it is possible to have an Iterable
that does define a well-behaved hashCode
/==
, e.g. BuiltList
https://pub.dev/documentation/built_collection/latest/built_collection/BuiltList/hashCode.html)
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.
I don't think it is very important - I think it is guarding against thinking you are doing a deep hash while you most probably are not (the default List has identity-based hashCode). This is not foolproof, and for example won't guard against Maps that have the same issue.
I agree that if an Iterable
implements a non-identity hashCode then the assertion is not-needed.
Not sure if there is a way of asking that question.
lib/web_ui/test/hash_codes_test.dart
Outdated
@@ -1,127 +0,0 @@ | |||
// Copyright 2013 The Flutter Authors. All rights reserved. |
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.
What problem motivated this test?
It seems very specific to some issue.
124a00b
to
1740683
Compare
This pull request executed golden file tests, but it has not been updated in a while (20+ days). Test results from Gold expire after as many days, so this pull request will need to be updated with a fresh commit in order to get results from Gold. |
c9c8d24
to
7782a0d
Compare
7782a0d
to
aff857b
Compare
Gold has detected about 38 new digest(s) on patchset 5. |
@Hixie is this ready to merge? |
8c00f66
to
fbf7119
Compare
fbf7119
to
c9c2a3b
Compare
waiting for flutter/packages#1581 to be merged, to prevent any rolling deprecation issues :) |
This appears to break the framework builds and the Flutter HHH builds |
Landed flutter/flutter@116d657 in the framework, which makes it compatible with this engine PR. |
* deprecate hashValues and hashList * rm unused imports * missing periods and const lists * improves hashing of lists * ignore: avoid_classes_with_only_static_members * migrate new classes * refactor: update version of deprecation
Deprecates
hashValues
andhashList
in favour ofObject.hash
andObject.hashAll
respectively.Fixes flutter/flutter#85431
Supposed to land after below listed PRs
hashValues
toObject.hash
flutter#96109Pre-launch Checklist
writing and running engine tests.
///
).If you need help, consider asking for advice on the #hackers-new channel on Discord.