Chromium Code Reviews| Index: pkg/collection/lib/src/utils.dart |
| diff --git a/pkg/collection/lib/src/utils.dart b/pkg/collection/lib/src/utils.dart |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..cc413fc6c6da417e1bb48d0be48a1e66e66e3f4f |
| --- /dev/null |
| +++ b/pkg/collection/lib/src/utils.dart |
| @@ -0,0 +1,22 @@ |
| +// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
| +// for details. All rights reserved. Use of this source code is governed by a |
| +// BSD-style license that can be found in the LICENSE file. |
| + |
| +library dart.pkg.collection.utils; |
| + |
| +/// A pair of values. |
| +class Pair<E, F> { |
| + E first; |
| + F last; |
| + |
| + Pair(this.first, this.last); |
| + |
| + String toString() => '($first, $last)'; |
| + |
| + bool operator==(other) { |
| + if (other is! Pair) return false; |
| + return other.first == first && other.last == last; |
| + } |
| + |
| + int get hashCode => first.hashCode ^ last.hashCode; |
|
Lasse Reichstein Nielsen
2014/07/01 09:18:15
I'd prefer some less symmetric operation, like
=
nweiz
2014/07/01 21:21:44
Removed these.
|
| +} |