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

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

Issue 11238035: Make isEmpty a getter. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Update status file 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-compiler.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 a8e244345054d32130f78d386a3d136c893f6637..eb13ac70b9cc2d341a3049caa7f6849e321403e6 100644
--- a/samples/ui_lib/touch/Momentum.dart
+++ b/samples/ui_lib/touch/Momentum.dart
@@ -455,7 +455,7 @@ class TimeoutMomentum implements Momentum {
_customDecelerationFactor, velocity.y);
if (!physicsX.isDone() || !physicsY.isDone()) {
_calculateMoves();
- if (!_moves.isEmpty()) {
+ if (!_moves.isEmpty) {
num firstTime = _moves.first().time;
_stepTimeout = Env.requestAnimationFrame(
_step, null, firstTime);
@@ -490,15 +490,15 @@ 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()
+ while (!_moves.isEmpty && _moves.first() !== _moves.last()
&& _moves.first().time < lastEpoch) {
_moves.removeFirst();
}
- if (!_moves.isEmpty()) {
+ if (!_moves.isEmpty) {
final move = _moves.removeFirst();
_delegate.onDecelerate(move.x, move.y);
- if (!_moves.isEmpty()) {
+ if (!_moves.isEmpty) {
num nextTime = _moves.first().time;
assert(_stepTimeout === null);
_stepTimeout = Env.requestAnimationFrame(_step, null, nextTime);
@@ -521,7 +521,7 @@ class TimeoutMomentum implements Momentum {
final wasDecelerating = _decelerating;
_decelerating = false;
Coordinate velocity;
- if (!_moves.isEmpty()) {
+ if (!_moves.isEmpty) {
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.
@@ -544,7 +544,7 @@ class TimeoutMomentum implements Momentum {
}
Coordinate get destination {
- if (!_moves.isEmpty()) {
+ if (!_moves.isEmpty) {
final lastMove = _moves.last();
return new Coordinate(lastMove.x, lastMove.y);
} else {
« no previous file with comments | « samples/ui_lib/observable/observable.dart ('k') | tests/co19/co19-compiler.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698