OLD | NEW |
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 dart.pkg.collection.comparators; | |
6 | |
7 // Character constants. | 5 // Character constants. |
8 const int _zero = 0x30; | 6 const int _zero = 0x30; |
9 const int _upperCaseA = 0x41; | 7 const int _upperCaseA = 0x41; |
10 const int _upperCaseZ = 0x5a; | 8 const int _upperCaseZ = 0x5a; |
11 const int _lowerCaseA = 0x61; | 9 const int _lowerCaseA = 0x61; |
12 const int _lowerCaseZ = 0x7a; | 10 const int _lowerCaseZ = 0x7a; |
13 const int _asciiCaseBit = 0x20; | 11 const int _asciiCaseBit = 0x20; |
14 | 12 |
15 /// Checks if strings [a] and [b] differ only on the case of ASCII letters. | 13 /// Checks if strings [a] and [b] differ only on the case of ASCII letters. |
16 /// | 14 /// |
(...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
390 /// If there is no non-zero digits before, then leading zeros at [index] | 388 /// If there is no non-zero digits before, then leading zeros at [index] |
391 /// are also ignored when comparing numerically. If there is a non-zero digit | 389 /// are also ignored when comparing numerically. If there is a non-zero digit |
392 /// before, then zeros at [index] are significant. | 390 /// before, then zeros at [index] are significant. |
393 bool _isNonZeroNumberSuffix(String string, int index) { | 391 bool _isNonZeroNumberSuffix(String string, int index) { |
394 while (--index >= 0) { | 392 while (--index >= 0) { |
395 int char = string.codeUnitAt(index); | 393 int char = string.codeUnitAt(index); |
396 if (char != _zero) return _isDigit(char); | 394 if (char != _zero) return _isDigit(char); |
397 } | 395 } |
398 return false; | 396 return false; |
399 } | 397 } |
OLD | NEW |