Skip to content

Added identical(a,b) short circuit ... finale - #121759

Merged
HansMuller merged 1 commit into
flutter:masterfrom
HansMuller:lerp_identical_finale
Mar 2, 2023
Merged

HansMuller merged 1 commit into
flutter:masterfrom
HansMuller:lerp_identical_finale

Conversation

@HansMuller

Copy link
Copy Markdown
Contributor

Final identical(a,b) short circuit update for the last two lerp methods.

Handle a common case in Foo.lerp(a, b, t): if a and b are identical, then just return a. This avoids needlessly constructing a new Foo and recursively lerping all of its properties. If a and b refer to the same const object, then we also preserve their singleton identity.

_CupertinoEdgeShadowDecoration.lerp was updated for the sake of consistency. There's no new test although the existing transition tests in test/cupertino/route.dart do functionally cover it.

This PR is similar to #120829

@flutter-dashboard flutter-dashboard Bot added p: cupertino_ui cupertino_ui package in flutter/packages f: routes Navigator, Router, and related APIs. framework flutter/packages/flutter repository. See also f: labels. labels Mar 2, 2023
@HansMuller
HansMuller force-pushed the lerp_identical_finale branch from 8f36de1 to e1ad417 Compare March 2, 2023 01:45
@HansMuller
HansMuller requested a review from goderbauer March 2, 2023 01:47

@goderbauer goderbauer left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@HansMuller
HansMuller merged commit a2814a6 into flutter:master Mar 2, 2023
@HansMuller
HansMuller deleted the lerp_identical_finale branch March 2, 2023 03:24
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 2, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 2, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 2, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 2, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 2, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 2, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 2, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 3, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 3, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 10, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

f: routes Navigator, Router, and related APIs. framework flutter/packages/flutter repository. See also f: labels. p: cupertino_ui cupertino_ui package in flutter/packages

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants