Skip to content

Commit e39fa7a

Browse files
authored
Fix wasted memory caused by debug fields - 16 bytes per object (when adding that should-be-removed field crosses double-word alignment) (#113927)
1 parent b816801 commit e39fa7a

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

packages/flutter/lib/src/animation/animation_controller.dart

+7-1
Original file line numberDiff line numberDiff line change
@@ -842,7 +842,13 @@ class AnimationController extends Animation<double>
842842
String toStringDetails() {
843843
final String paused = isAnimating ? '' : '; paused';
844844
final String ticker = _ticker == null ? '; DISPOSED' : (_ticker!.muted ? '; silenced' : '');
845-
final String label = debugLabel == null ? '' : '; for $debugLabel';
845+
String label = '';
846+
assert(() {
847+
if (debugLabel != null) {
848+
label = '; for $debugLabel';
849+
}
850+
return true;
851+
}());
846852
final String more = '${super.toStringDetails()} ${value.toStringAsFixed(3)}';
847853
return '$more$paused$ticker$label';
848854
}

0 commit comments

Comments
 (0)