| OLD | NEW |
| 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 analyzer.src.generated.utilities_collection; | 5 library analyzer.src.generated.utilities_collection; |
| 6 | 6 |
| 7 import 'dart:collection'; | 7 import 'dart:collection'; |
| 8 import "dart:math" as math; | 8 import "dart:math" as math; |
| 9 | 9 |
| 10 import 'package:analyzer/src/generated/java_core.dart'; | 10 import 'package:analyzer/src/generated/java_core.dart'; |
| 11 import 'package:analyzer/src/generated/scanner.dart' show Token; | 11 import 'package:analyzer/src/generated/scanner.dart' show Token; |
| 12 | 12 |
| 13 /** | 13 /** |
| 14 * Returns `true` if a and b contain equal elements in the same order. |
| 15 */ |
| 16 bool listsEqual(List a, List b) { |
| 17 // TODO(rnystrom): package:collection also implements this, and analyzer |
| 18 // already transitively depends on that package. Consider using it instead. |
| 19 if (identical(a, b)) { |
| 20 return true; |
| 21 } |
| 22 |
| 23 if (a.length != b.length) { |
| 24 return false; |
| 25 } |
| 26 |
| 27 for (int i = 0; i < a.length; i++) { |
| 28 if (a[i] != b[i]) { |
| 29 return false; |
| 30 } |
| 31 } |
| 32 |
| 33 return true; |
| 34 } |
| 35 |
| 36 /** |
| 14 * The class `BooleanArray` defines methods for operating on integers as if they
were arrays | 37 * The class `BooleanArray` defines methods for operating on integers as if they
were arrays |
| 15 * of booleans. These arrays can be indexed by either integers or by enumeration
constants. | 38 * of booleans. These arrays can be indexed by either integers or by enumeration
constants. |
| 16 */ | 39 */ |
| 17 class BooleanArray { | 40 class BooleanArray { |
| 18 /** | 41 /** |
| 19 * Return the value of the element at the given index. | 42 * Return the value of the element at the given index. |
| 20 * | 43 * |
| 21 * @param array the array being accessed | 44 * @param array the array being accessed |
| 22 * @param index the index of the element being accessed | 45 * @param index the index of the element being accessed |
| 23 * @return the value of the element at the given index | 46 * @return the value of the element at the given index |
| (...skipping 691 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 715 /** | 738 /** |
| 716 * Map the key to the value. | 739 * Map the key to the value. |
| 717 * | 740 * |
| 718 * @param key the token being mapped to the value | 741 * @param key the token being mapped to the value |
| 719 * @param value the token to which the key will be mapped | 742 * @param value the token to which the key will be mapped |
| 720 */ | 743 */ |
| 721 void put(Token key, Token value) { | 744 void put(Token key, Token value) { |
| 722 _map[key] = value; | 745 _map[key] = value; |
| 723 } | 746 } |
| 724 } | 747 } |
| OLD | NEW |