Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(599)

Unified Diff: sky/sdk/lib/widgets/widget.dart

Issue 1217473004: Make rebuilding faster (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/sdk/lib/widgets/widget.dart
diff --git a/sky/sdk/lib/widgets/widget.dart b/sky/sdk/lib/widgets/widget.dart
index 78209f0245206399bbaae0201054816d13cda470..d8b575a30ba3bb23cb7ab7c577719a62d3ca81ad 100644
--- a/sky/sdk/lib/widgets/widget.dart
+++ b/sky/sdk/lib/widgets/widget.dart
@@ -46,7 +46,7 @@ abstract class Widget {
bool _wasMounted = false;
bool get mounted => _mounted;
static bool _notifyingMountStatus = false;
- static Set<Widget> _mountedChanged = new HashSet<Widget>();
+ static List<Widget> _mountedChanged = new List<Widget>();
void setParent(Widget newParent) {
assert(!_notifyingMountStatus);
@@ -141,23 +141,21 @@ abstract class Widget {
return null;
}
- if (oldNode != null &&
- oldNode.runtimeType == node.runtimeType &&
- oldNode.key == node.key &&
- node._retainStatefulNodeIfPossible(oldNode)) {
- assert(oldNode.mounted);
- assert(!node.mounted);
- oldNode._sync(node, slot);
- assert(oldNode.root is RenderObject);
- return oldNode;
- }
-
- if (oldNode != null &&
- (oldNode.runtimeType != node.runtimeType || oldNode.key != node.key)) {
- assert(oldNode.mounted);
- oldNode.detachRoot();
- removeChild(oldNode);
- oldNode = null;
+ if (oldNode != null) {
+ if (oldNode.runtimeType == node.runtimeType && oldNode.key == node.key) {
+ if (node._retainStatefulNodeIfPossible(oldNode)) {
+ assert(oldNode.mounted);
+ assert(!node.mounted);
+ oldNode._sync(node, slot);
+ assert(oldNode.root is RenderObject);
+ return oldNode;
+ }
+ } else {
+ assert(oldNode.mounted);
+ oldNode.detachRoot();
+ removeChild(oldNode);
+ oldNode = null;
+ }
}
assert(!node.mounted);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698