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

Side by Side Diff: lib/src/transcript.dart

Issue 1585513002: Get rid of all the library tags. (Closed) Base URL: git@github.com:dart-lang/pub.git@master
Patch Set: Created 4 years, 11 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
« no previous file with comments | « lib/src/system_cache.dart ('k') | lib/src/utils.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) 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 library pub.transcript;
6
7 import 'dart:collection'; 5 import 'dart:collection';
8 6
9 /// A rolling transcript of entries of type [T]. 7 /// A rolling transcript of entries of type [T].
10 /// 8 ///
11 /// It has a maximum number of entries. If entries are added that exceed that 9 /// It has a maximum number of entries. If entries are added that exceed that
12 /// it discards entries from the *middle* of the transcript. Generally, in logs, 10 /// it discards entries from the *middle* of the transcript. Generally, in logs,
13 /// the first and last entries are the most important, so it maintains those. 11 /// the first and last entries are the most important, so it maintains those.
14 class Transcript<T> { 12 class Transcript<T> {
15 /// The maximum number of transcript entries. 13 /// The maximum number of transcript entries.
16 final int max; 14 final int max;
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 /// invoke [onGap]. 62 /// invoke [onGap].
65 void forEach(void onEntry(T entry), [void onGap(int)]) { 63 void forEach(void onEntry(T entry), [void onGap(int)]) {
66 if (_oldest.isNotEmpty) { 64 if (_oldest.isNotEmpty) {
67 _oldest.forEach(onEntry); 65 _oldest.forEach(onEntry);
68 if (onGap != null) onGap(discarded); 66 if (onGap != null) onGap(discarded);
69 } 67 }
70 68
71 _newest.forEach(onEntry); 69 _newest.forEach(onEntry);
72 } 70 }
73 } 71 }
OLDNEW
« no previous file with comments | « lib/src/system_cache.dart ('k') | lib/src/utils.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698