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

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

Issue 1303033010: Navigation extension point. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: tweaks Created 5 years, 3 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
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 library collections; 5 library collections;
6 6
7 /** 7 /**
8 * Returns the concatentation of the input iterables. 8 * Returns the concatentation of the input iterables.
9 * 9 *
10 * The returned iterable is a lazily-evaluated view on the input iterables. 10 * The returned iterable is a lazily-evaluated view on the input iterables.
(...skipping 10 matching lines...) Expand all
21 */ 21 */
22 List nullIfEmpty(List list) { 22 List nullIfEmpty(List 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
32 /// A pair of values.
33 class Pair<E, F> {
34 final E first;
35 final F last;
36
37 Pair(this.first, this.last);
38
39 int get hashCode => first.hashCode ^ last.hashCode;
40
41 bool operator ==(other) {
42 if (other is! Pair) return false;
43 return other.first == first && other.last == last;
44 }
45
46 String toString() => '($first, $last)';
47 }
OLDNEW
« no previous file with comments | « pkg/analysis_server/lib/src/analysis_server.dart ('k') | pkg/analysis_server/lib/src/computer/computer_navigation.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698