Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
46792dc2
Commit
46792dc2
authored
Jan 26, 2017
by
Ian Hickson
Committed by
GitHub
Jan 26, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Speed up hot reload in the framework. (#7647)
parent
25223c75
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
15 deletions
+15
-15
framework.dart
packages/flutter/lib/src/widgets/framework.dart
+15
-15
No files found.
packages/flutter/lib/src/widgets/framework.dart
View file @
46792dc2
...
@@ -1606,7 +1606,6 @@ class BuildOwner {
...
@@ -1606,7 +1606,6 @@ class BuildOwner {
void
scheduleBuildFor
(
BuildableElement
element
)
{
void
scheduleBuildFor
(
BuildableElement
element
)
{
assert
(
element
!=
null
);
assert
(
element
!=
null
);
assert
(
element
.
owner
==
this
);
assert
(
element
.
owner
==
this
);
assert
(
element
.
_inDirtyList
==
_dirtyElements
.
contains
(
element
));
assert
(()
{
assert
(()
{
if
(
debugPrintScheduleBuildForStacks
)
if
(
debugPrintScheduleBuildForStacks
)
debugPrintStack
(
label:
'scheduleBuildFor() called for
$element${_dirtyElements.contains(element) ? " (ALREADY IN LIST)" : ""}
'
);
debugPrintStack
(
label:
'scheduleBuildFor() called for
$element${_dirtyElements.contains(element) ? " (ALREADY IN LIST)" : ""}
'
);
...
@@ -1944,18 +1943,18 @@ abstract class Element implements BuildContext {
...
@@ -1944,18 +1943,18 @@ abstract class Element implements BuildContext {
bool
_active
=
false
;
bool
_active
=
false
;
void
_reassemble
()
{
void
_reassemble
()
{
assert
(
_active
);
visitChildren
((
Element
child
)
{
visitChildren
((
Element
child
)
{
child
.
_reassemble
();
child
.
_reassemble
();
});
});
}
}
bool
_debugIsInScope
(
Element
target
)
{
bool
_debugIsInScope
(
Element
target
)
{
assert
(
target
!=
null
);
Element
current
=
this
;
if
(
target
==
this
)
while
(
current
!=
null
)
{
return
true
;
if
(
target
==
current
)
if
(
_parent
!=
null
)
return
true
;
return
_parent
.
_debugIsInScope
(
target
);
current
=
current
.
_parent
;
}
return
false
;
return
false
;
}
}
...
@@ -2099,13 +2098,15 @@ abstract class Element implements BuildContext {
...
@@ -2099,13 +2098,15 @@ abstract class Element implements BuildContext {
/// This function is called only during the "active" lifecycle state.
/// This function is called only during the "active" lifecycle state.
@mustCallSuper
@mustCallSuper
void
update
(
@checked
Widget
newWidget
)
{
void
update
(
@checked
Widget
newWidget
)
{
assert
(
_debugLifecycleState
==
_ElementLifecycle
.
active
);
// This code is hot when hot reloading, so we try to
assert
(
widget
!=
null
);
// only call _AssertionError._evaluateAssertion once.
assert
(
newWidget
!=
null
);
assert
(
_debugLifecycleState
==
_ElementLifecycle
.
active
assert
(
newWidget
!=
widget
);
&&
widget
!=
null
assert
(
depth
!=
null
);
&&
newWidget
!=
null
assert
(
_active
);
&&
newWidget
!=
widget
assert
(
Widget
.
canUpdate
(
widget
,
newWidget
));
&&
depth
!=
null
&&
_active
&&
Widget
.
canUpdate
(
widget
,
newWidget
));
_widget
=
newWidget
;
_widget
=
newWidget
;
}
}
...
@@ -2795,7 +2796,6 @@ abstract class BuildableElement extends Element {
...
@@ -2795,7 +2796,6 @@ abstract class BuildableElement extends Element {
@override
@override
void
_reassemble
()
{
void
_reassemble
()
{
assert
(
_active
);
// otherwise markNeedsBuild is a no-op
markNeedsBuild
();
markNeedsBuild
();
super
.
_reassemble
();
super
.
_reassemble
();
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment