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

Side by Side Diff: pkg/analysis_server/lib/src/collections.dart

Issue 2952233002: Fix hints and clean-up obsolete comment syntax (TBR) (Closed)
Patch Set: Created 3 years, 6 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 | « no previous file | pkg/analysis_server/lib/src/domain_analysis.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) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 * Returns the concatenation of the input [iterables]. 6 * Returns the concatenation of the input [iterables].
7 * 7 *
8 * The returned iterable is a lazily-evaluated view on the input iterables. 8 * The returned iterable is a lazily-evaluated view on the input iterables.
9 */ 9 */
10 Iterable/*<E>*/ concat/*<E>*/(Iterable<Iterable/*<E>*/ > iterables) => 10 Iterable<E> concat<E>(Iterable<Iterable<E>> iterables) =>
11 iterables.expand((x) => x); 11 iterables.expand((x) => x);
12 12
13 /** 13 /**
14 * Returns the concatenation of the input [iterables] as a [List]. 14 * Returns the concatenation of the input [iterables] as a [List].
15 */ 15 */
16 List/*<E>*/ concatToList/*<E>*/(Iterable<Iterable/*<E>*/ > iterables) => 16 List<E> concatToList<E>(Iterable<Iterable<E>> iterables) =>
17 concat(iterables).toList(); 17 concat(iterables).toList();
18 18
19 /** 19 /**
20 * Returns the given [list] if it is not empty, or `null` otherwise. 20 * Returns the given [list] if it is not empty, or `null` otherwise.
21 */ 21 */
22 List/*<E>*/ nullIfEmpty/*<E>*/(List/*<E>*/ list) { 22 List<E> nullIfEmpty<E>(List<E> list) {
23 if (list == null) { 23 if (list == null) {
24 return null; 24 return null;
25 } 25 }
26 if (list.isEmpty) { 26 if (list.isEmpty) {
27 return null; 27 return null;
28 } 28 }
29 return list; 29 return list;
30 } 30 }
31 31
32 /// A pair of values. 32 /// A pair of values.
(...skipping 29 matching lines...) Expand all
62 Iterable<T> get items => _buffer.reversed; 62 Iterable<T> get items => _buffer.reversed;
63 63
64 void add(T item) { 64 void add(T item) {
65 _buffer.add(item); 65 _buffer.add(item);
66 66
67 if (_buffer.length > capacity) { 67 if (_buffer.length > capacity) {
68 _buffer.removeAt(0); 68 _buffer.removeAt(0);
69 } 69 }
70 } 70 }
71 } 71 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analysis_server/lib/src/domain_analysis.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698