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

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

Issue 2484163002: Fix bug in equalsIgnoreAsciiCase. (Closed)
Patch Set: Address comments, add missing import. 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
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 import "comparators.dart";
nweiz 2016/11/11 23:16:46 Nit: newline above.
Lasse Reichstein Nielsen 2016/11/14 14:52:04 Done.
6 7
7 const int _HASH_MASK = 0x7fffffff; 8 const int _HASH_MASK = 0x7fffffff;
8 9
9 /// A generic equality relation on objects. 10 /// A generic equality relation on objects.
10 abstract class Equality<E> { 11 abstract class Equality<E> {
11 const factory Equality() = DefaultEquality<E>; 12 const factory Equality() = DefaultEquality<E>;
12 13
13 /// Compare two elements for being equal. 14 /// Compare two elements for being equal.
14 /// 15 ///
15 /// This should be a proper equality relation. 16 /// This should be a proper equality relation.
(...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after
389 class CaseInsensitiveEquality implements Equality<String> { 390 class CaseInsensitiveEquality implements Equality<String> {
390 const CaseInsensitiveEquality(); 391 const CaseInsensitiveEquality();
391 392
392 bool equals(String string1, String string2) => 393 bool equals(String string1, String string2) =>
393 equalsIgnoreAsciiCase(string1, string2); 394 equalsIgnoreAsciiCase(string1, string2);
394 395
395 int hash(String string) => hashIgnoreAsciiCase(string); 396 int hash(String string) => hashIgnoreAsciiCase(string);
396 397
397 bool isValidKey(Object object) => object is String; 398 bool isValidKey(Object object) => object is String;
398 } 399 }
OLDNEW
« no previous file with comments | « lib/src/comparators.dart ('k') | pubspec.yaml » ('j') | pubspec.yaml » ('J')

Powered by Google App Engine
This is Rietveld 408576698