Sort diagnostics node dependencies so that order is stable#105319
Merged
kenzieschmoll merged 5 commits intoflutter:masterfrom Jun 6, 2022
Merged
Sort diagnostics node dependencies so that order is stable#105319kenzieschmoll merged 5 commits intoflutter:masterfrom
kenzieschmoll merged 5 commits intoflutter:masterfrom
Conversation
jacob314
reviewed
Jun 3, 2022
| .map((InheritedElement element) => element.widget.toDiagnosticsNode(style: DiagnosticsTreeStyle.sparse)) | ||
| .toList(); | ||
| .toList() | ||
| ..sort((DiagnosticsNode a, DiagnosticsNode b) => '$a'.compareTo('$b')); |
Contributor
There was a problem hiding this comment.
the toString for a DiagnosticsNode can be long and expensive (although shouldn't really be in this case). I would just use
toStringShort() instead to be safe to make sure we don't end up doing O(n log n) computations of the full toString version of a diagnostic.
jacob314
reviewed
Jun 3, 2022
| @@ -4455,7 +4455,12 @@ abstract class Element extends DiagnosticableTree implements BuildContext { | |||
| if (_dependencies != null && _dependencies!.isNotEmpty) { | |||
| final List<DiagnosticsNode> diagnosticsDependencies = _dependencies! | |||
| .map((InheritedElement element) => element.widget.toDiagnosticsNode(style: DiagnosticsTreeStyle.sparse)) | |||
Contributor
There was a problem hiding this comment.
Sort while you still have a List and you can use toStringShort or just the runtime type of the Widget class which would also be reasonable.
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/plugins
that referenced
this pull request
Jun 6, 2022
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Jun 6, 2022
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Jun 6, 2022
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Jun 6, 2022
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Jun 6, 2022
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Jun 6, 2022
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Jun 7, 2022
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Jun 7, 2022
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Jun 7, 2022
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Jun 7, 2022
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Jun 7, 2022
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Jun 7, 2022
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Jun 7, 2022
camsim99
pushed a commit
to camsim99/flutter
that referenced
this pull request
Aug 10, 2022
…05319) * Sort diagnostics node dependencies so that order is stable * use toDescription * use toStringShort when possible * sort InheritedElements
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Aug 30, 2022
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/plugins
that referenced
this pull request
Aug 30, 2022
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.

This will fix flutter/devtools#4081.
@jacob314