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

Side by Side Diff: sdk/lib/core/queue.dart

Issue 11377102: Remove named function literals from library and tests (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 1 month 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
« no previous file with comments | « sdk/lib/core/map.dart ('k') | sdk/lib/core/set.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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 /** 5 /**
6 * A [Queue] is a collection that can be manipulated at both ends. One 6 * A [Queue] is a collection that can be manipulated at both ends. One
7 * can iterate over the elements of a queue through [forEach] or with 7 * can iterate over the elements of a queue through [forEach] or with
8 * an [Iterator]. 8 * an [Iterator].
9 */ 9 */
10 abstract class Queue<E> extends Collection<E> { 10 abstract class Queue<E> extends Collection<E> {
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
222 DoubleLinkedQueueEntry<E> lastEntry() { 222 DoubleLinkedQueueEntry<E> lastEntry() {
223 return _sentinel.previousEntry(); 223 return _sentinel.previousEntry();
224 } 224 }
225 225
226 DoubleLinkedQueueEntry<E> firstEntry() { 226 DoubleLinkedQueueEntry<E> firstEntry() {
227 return _sentinel.nextEntry(); 227 return _sentinel.nextEntry();
228 } 228 }
229 229
230 int get length { 230 int get length {
231 int counter = 0; 231 int counter = 0;
232 forEach(void _(E element) { counter++; }); 232 forEach((E element) { counter++; });
233 return counter; 233 return counter;
234 } 234 }
235 235
236 bool get isEmpty { 236 bool get isEmpty {
237 return (identical(_sentinel._next, _sentinel)); 237 return (identical(_sentinel._next, _sentinel));
238 } 238 }
239 239
240 void clear() { 240 void clear() {
241 _sentinel._next = _sentinel; 241 _sentinel._next = _sentinel;
242 _sentinel._previous = _sentinel; 242 _sentinel._previous = _sentinel;
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
329 } 329 }
330 330
331 E next() { 331 E next() {
332 if (!hasNext) { 332 if (!hasNext) {
333 throw new StateError("No more elements"); 333 throw new StateError("No more elements");
334 } 334 }
335 _currentEntry = _currentEntry._next; 335 _currentEntry = _currentEntry._next;
336 return _currentEntry.element; 336 return _currentEntry.element;
337 } 337 }
338 } 338 }
OLDNEW
« no previous file with comments | « sdk/lib/core/map.dart ('k') | sdk/lib/core/set.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698