Remove _emptyList from fn2.dart

We can use const [] instead and we'll be sure we don't mutate this constant.

R=ianh@google.com

Review URL: https://codereview.chromium.org/1178623002.
This commit is contained in:
Adam Barth 2015-06-10 12:42:41 -07:00
parent 633ba8c811
commit 4806a4cc04
2 changed files with 3 additions and 8 deletions

View File

@ -530,8 +530,6 @@ class CustomPaint extends OneChildRenderObjectWrapper {
}
final List<UINode> _emptyList = new List<UINode>();
abstract class MultiChildRenderObjectWrapper extends RenderObjectWrapper {
// In MultiChildRenderObjectWrapper subclasses, slots are RenderObject nodes
@ -540,10 +538,8 @@ abstract class MultiChildRenderObjectWrapper extends RenderObjectWrapper {
MultiChildRenderObjectWrapper({
Object key,
List<UINode> children
}) : this.children = children == null ? _emptyList : children,
super(
key: key
) {
}) : this.children = children == null ? const [] : children,
super(key: key) {
assert(!_debugHasDuplicateIds());
}

View File

@ -51,8 +51,7 @@ same order (unless the order matters).
All variables and arguments are typed; don't use "var", "dynamic", or
"Object" in any case where you could figure out the actual type.
Always specialise generic types where possible. Even for ```[]``` and
```{}``` literals, include the types.
Always specialise generic types where possible.
Aim for a line length of 80 characters, but go over if breaking the
line would make it less readable.