OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 /** | 5 /** |
6 * [SearchText] represent the search field text. The text is viewed in three | 6 * [SearchText] represent the search field text. The text is viewed in three |
7 * ways: [text] holds the original search text, used for performing | 7 * ways: [text] holds the original search text, used for performing |
8 * case-sensitive matches, [lowerCase] holds the lower-case search text, used | 8 * case-sensitive matches, [lowerCase] holds the lower-case search text, used |
9 * for performing case-insenstive matches, [camelCase] holds a camel-case | 9 * for performing case-insenstive matches, [camelCase] holds a camel-case |
10 * interpretation of the search text, used to order matches in camel-case. | 10 * interpretation of the search text, used to order matches in camel-case. |
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
209 // Sort type alphabetically. | 209 // Sort type alphabetically. |
210 // TODO(4805): Use [:type.compareToIgnoreCase] when supported. | 210 // TODO(4805): Use [:type.compareToIgnoreCase] when supported. |
211 result = a.type.toLowerCase().compareTo(b.type.toLowerCase()); | 211 result = a.type.toLowerCase().compareTo(b.type.toLowerCase()); |
212 if (result != 0) return result; | 212 if (result != 0) return result; |
213 } | 213 } |
214 | 214 |
215 // Sort match alphabetically. | 215 // Sort match alphabetically. |
216 // TODO(4805): Use [:text.compareToIgnoreCase] when supported. | 216 // TODO(4805): Use [:text.compareToIgnoreCase] when supported. |
217 return a.match.text.toLowerCase().compareTo(b.match.text.toLowerCase()); | 217 return a.match.text.toLowerCase().compareTo(b.match.text.toLowerCase()); |
218 } | 218 } |
OLD | NEW |