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

Side by Side Diff: lib/src/equality.dart

Issue 2484163002: Fix bug in equalsIgnoreAsciiCase. (Closed)
Patch Set: Address comments Created 4 years, 1 month 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 unified diff | Download patch
« no previous file with comments | « lib/src/comparators.dart ('k') | pubspec.yaml » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 import "dart:collection"; 5 import "dart:collection";
6 6
7 import "comparators.dart";
8
7 const int _HASH_MASK = 0x7fffffff; 9 const int _HASH_MASK = 0x7fffffff;
8 10
9 /// A generic equality relation on objects. 11 /// A generic equality relation on objects.
10 abstract class Equality<E> { 12 abstract class Equality<E> {
11 const factory Equality() = DefaultEquality<E>; 13 const factory Equality() = DefaultEquality<E>;
12 14
13 /// Compare two elements for being equal. 15 /// Compare two elements for being equal.
14 /// 16 ///
15 /// This should be a proper equality relation. 17 /// This should be a proper equality relation.
16 bool equals(E e1, E e2); 18 bool equals(E e1, E e2);
(...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after
389 class CaseInsensitiveEquality implements Equality<String> { 391 class CaseInsensitiveEquality implements Equality<String> {
390 const CaseInsensitiveEquality(); 392 const CaseInsensitiveEquality();
391 393
392 bool equals(String string1, String string2) => 394 bool equals(String string1, String string2) =>
393 equalsIgnoreAsciiCase(string1, string2); 395 equalsIgnoreAsciiCase(string1, string2);
394 396
395 int hash(String string) => hashIgnoreAsciiCase(string); 397 int hash(String string) => hashIgnoreAsciiCase(string);
396 398
397 bool isValidKey(Object object) => object is String; 399 bool isValidKey(Object object) => object is String;
398 } 400 }
OLDNEW
« no previous file with comments | « lib/src/comparators.dart ('k') | pubspec.yaml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698