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

Unified Diff: lib/src/utils.dart

Issue 1092153003: Support an @OnPlatform annotation. (Closed) Base URL: git@github.com:dart-lang/test@master
Patch Set: Created 5 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « lib/src/runner/parse_metadata.dart ('k') | test/backend/metadata_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/utils.dart
diff --git a/lib/src/utils.dart b/lib/src/utils.dart
index 3b8111d0f379e9a1171f397c54c42e0984c937e8..f236814aa7a902cfe79a74a67f269a4c4d81cf72 100644
--- a/lib/src/utils.dart
+++ b/lib/src/utils.dart
@@ -51,6 +51,23 @@ final OperatingSystem currentOSGuess = (() {
return OperatingSystem.linux;
})();
+/// A pair of values.
+class Pair<E, F> {
+ E first;
kevmoo 2015/04/21 03:48:38 both could be final?
nweiz 2015/04/21 20:01:04 I'd rather keep this identical to the implementati
+ F last;
+
+ Pair(this.first, this.last);
+
+ String toString() => '($first, $last)';
+
+ bool operator==(other) {
kevmoo 2015/04/21 03:48:38 I'm a big fan of other is Pair && other.first == f
+ if (other is! Pair) return false;
+ return other.first == first && other.last == last;
+ }
+
+ int get hashCode => first.hashCode ^ last.hashCode;
+}
+
/// Get a string description of an exception.
///
/// Many exceptions include the exception class name at the beginning of their
« no previous file with comments | « lib/src/runner/parse_metadata.dart ('k') | test/backend/metadata_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698