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

Unified Diff: samples/ui_lib/touch/Momentum.dart

Issue 11273041: Make first and last getters. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Update status files with co19 issue number. Created 8 years, 2 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 | « samples/ui_lib/observable/observable.dart ('k') | tests/co19/co19-dart2dart.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: samples/ui_lib/touch/Momentum.dart
diff --git a/samples/ui_lib/touch/Momentum.dart b/samples/ui_lib/touch/Momentum.dart
index eb13ac70b9cc2d341a3049caa7f6849e321403e6..269b722e5b4f4a34eea6a36cc04aa2a3f8b9131f 100644
--- a/samples/ui_lib/touch/Momentum.dart
+++ b/samples/ui_lib/touch/Momentum.dart
@@ -456,7 +456,7 @@ class TimeoutMomentum implements Momentum {
if (!physicsX.isDone() || !physicsY.isDone()) {
_calculateMoves();
if (!_moves.isEmpty) {
- num firstTime = _moves.first().time;
+ num firstTime = _moves.first.time;
_stepTimeout = Env.requestAnimationFrame(
_step, null, firstTime);
_decelerating = true;
@@ -490,8 +490,8 @@ class TimeoutMomentum implements Momentum {
// Prune moves that are more than 1 frame behind when we have more
// available moves.
num lastEpoch = timestamp - SingleDimensionPhysics._MS_PER_FRAME;
- while (!_moves.isEmpty && _moves.first() !== _moves.last()
- && _moves.first().time < lastEpoch) {
+ while (!_moves.isEmpty && _moves.first !== _moves.last
+ && _moves.first.time < lastEpoch) {
_moves.removeFirst();
}
@@ -499,7 +499,7 @@ class TimeoutMomentum implements Momentum {
final move = _moves.removeFirst();
_delegate.onDecelerate(move.x, move.y);
if (!_moves.isEmpty) {
- num nextTime = _moves.first().time;
+ num nextTime = _moves.first.time;
assert(_stepTimeout === null);
_stepTimeout = Env.requestAnimationFrame(_step, null, nextTime);
} else {
@@ -522,7 +522,7 @@ class TimeoutMomentum implements Momentum {
_decelerating = false;
Coordinate velocity;
if (!_moves.isEmpty) {
- final move = _moves.first();
+ final move = _moves.first;
// This is a workaround for the ugly hacks that get applied when a user
// passed a velocity in to this Momentum implementation.
num velocityScale = SingleDimensionPhysics._MS_PER_FRAME *
@@ -545,7 +545,7 @@ class TimeoutMomentum implements Momentum {
Coordinate get destination {
if (!_moves.isEmpty) {
- final lastMove = _moves.last();
+ final lastMove = _moves.last;
return new Coordinate(lastMove.x, lastMove.y);
} else {
return null;
« no previous file with comments | « samples/ui_lib/observable/observable.dart ('k') | tests/co19/co19-dart2dart.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698