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

Side by Side Diff: sdk/lib/async/timer.dart

Issue 12817003: Change getRange to sublist. Make getRange deprecated. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Addressed review comments Created 7 years, 9 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 part of dart.async; 5 part of dart.async;
6 6
7 abstract class Timer { 7 abstract class Timer {
8 // Internal list used to group Timer.run callbacks. 8 // Internal list used to group Timer.run callbacks.
9 static List _runCallbacks = []; 9 static List _runCallbacks = [];
10 10
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 _runCallbacks = []; 54 _runCallbacks = [];
55 for (int i = 0; i < runCallbacks.length; i++) { 55 for (int i = 0; i < runCallbacks.length; i++) {
56 Function callback = runCallbacks[i]; 56 Function callback = runCallbacks[i];
57 try { 57 try {
58 callback(); 58 callback();
59 } catch (e) { 59 } catch (e) {
60 List newCallbacks = _runCallbacks; 60 List newCallbacks = _runCallbacks;
61 _runCallbacks = []; 61 _runCallbacks = [];
62 i++; // Skip the current; 62 i++; // Skip the current;
63 _runCallbacks.addAll( 63 _runCallbacks.addAll(
64 runCallbacks.getRange(i, runCallbacks.length - i)); 64 runCallbacks.sublist(i));
65 _runCallbacks.addAll(newCallbacks); 65 _runCallbacks.addAll(newCallbacks);
66 throw; 66 throw;
67 } 67 }
68 } 68 }
69 }); 69 });
70 } 70 }
71 } 71 }
72 72
73 /** 73 /**
74 * Cancels the timer. 74 * Cancels the timer.
75 */ 75 */
76 void cancel(); 76 void cancel();
77 } 77 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698