Unverified Commit a1aea2e4 authored by Jason Simmons's avatar Jason Simmons Committed by GitHub

Use a simpler implementation of Diagnosticable.toString when running in...

Use a simpler implementation of Diagnosticable.toString when running in profile/release mode (#28661)

Diagnosticable.toString may be called in performance sensitive contexts
(for example, creating debug labels for Tickers)
parent c3527389
...@@ -2127,7 +2127,12 @@ abstract class Diagnosticable { ...@@ -2127,7 +2127,12 @@ abstract class Diagnosticable {
@override @override
String toString({ DiagnosticLevel minLevel = DiagnosticLevel.debug }) { String toString({ DiagnosticLevel minLevel = DiagnosticLevel.debug }) {
return toDiagnosticsNode(style: DiagnosticsTreeStyle.singleLine).toString(minLevel: minLevel); String fullString;
assert(() {
fullString = toDiagnosticsNode(style: DiagnosticsTreeStyle.singleLine).toString(minLevel: minLevel);
return true;
}());
return fullString ?? toStringShort();
} }
/// Returns a debug representation of the object that is used by debugging /// Returns a debug representation of the object that is used by debugging
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment