Avoid 'as' keyword

It has performance implications in release mode.

We'll enable the lint once https://github.com/dart-lang/linter/issues/195 is fixed.
This commit is contained in:
Hixie
2016-03-09 14:06:42 -08:00
parent 778c3a05b1
commit 5810cd80bd
10 changed files with 57 additions and 36 deletions

View File

@@ -138,14 +138,14 @@ class Instrumentation {
/// the element's render object has been laid out at least once.
Size getSize(Element element) {
assert(element != null);
RenderBox box = element.renderObject as RenderBox;
RenderBox box = element.renderObject;
assert(box != null);
return box.size;
}
Point _getElementPoint(Element element, SizeToPointFunction sizeToPoint) {
assert(element != null);
RenderBox box = element.renderObject as RenderBox;
RenderBox box = element.renderObject;
assert(box != null);
return box.localToGlobal(sizeToPoint(box.size));
}