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

Issue 1412293008: Add string comparators that can compare ASCII strings ignoring case. (Closed)

Created:
5 years, 1 month ago by Lasse Reichstein Nielsen
Modified:
5 years, 1 month ago
CC:
reviews_dartlang.org
Base URL:
https://github.com/dart-lang/collection.git@master
Target Ref:
refs/heads/master
Visibility:
Public.

Description

Add string comparators that can compare ASCII strings ignoring case. Also add comparators that compare digit sequences lexicographically (which is the same as comparing numerically if there are no leading zeros). The comparison functions define total orderings, breaking ties for strings that only differ by case by their first case-different letter, upper-case being less than lower-case. R=floitsch@google.com, rnystrom@google.com, sra@google.com Committed: https://github.com/dart-lang/collection/commit/c94b8dc745ef332270bece64daab7f545bf0452d

Patch Set 1 #

Total comments: 10

Patch Set 2 : Address comments. #

Total comments: 18

Patch Set 3 : Address comments. PTAL #

Total comments: 14

Patch Set 4 : Address comments. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+524 lines, -1 line) Patch
M CHANGELOG.md View 1 2 1 chunk +4 lines, -0 lines 0 comments Download
M lib/collection.dart View 1 chunk +1 line, -0 lines 0 comments Download
A lib/src/comparators.dart View 1 2 3 1 chunk +399 lines, -0 lines 0 comments Download
M pubspec.yaml View 1 1 chunk +1 line, -1 line 0 comments Download
A test/comparators_test.dart View 1 2 3 1 chunk +119 lines, -0 lines 0 comments Download

Messages

Total messages: 25 (5 generated)
Lasse Reichstein Nielsen
After seeing sort((a,b)=>a.toUpperCase().compareTo(b.toUpperCase())) once too often.
5 years, 1 month ago (2015-11-09 15:59:21 UTC) #2
sra1
DBC. I think I would rather have a sort function that takes a 'key:' argument ...
5 years, 1 month ago (2015-11-10 04:41:40 UTC) #4
Lasse Reichstein Nielsen
> I think I would rather have a sort function that takes a 'key:' argument ...
5 years, 1 month ago (2015-11-10 08:21:33 UTC) #5
kevmoo
Do we NEED this in the core SDK? Could it be in a package? What's ...
5 years, 1 month ago (2015-11-10 19:28:45 UTC) #7
kevmoo
https://codereview.chromium.org/1412293008/diff/1/lib/src/comparators.dart File lib/src/comparators.dart (right): https://codereview.chromium.org/1412293008/diff/1/lib/src/comparators.dart#newcode16 lib/src/comparators.dart:16: /// strings with a known structure. Describe how non-ASCII ...
5 years, 1 month ago (2015-11-10 19:30:35 UTC) #8
Lasse Reichstein Nielsen
On 2015/11/10 19:28:45, kevmoo wrote: > Do we NEED this in the core SDK? Could ...
5 years, 1 month ago (2015-11-11 06:16:03 UTC) #9
kevmoo
On 2015/11/11 06:16:03, Lasse Reichstein Nielsen wrote: > On 2015/11/10 19:28:45, kevmoo wrote: > > ...
5 years, 1 month ago (2015-11-11 06:27:19 UTC) #10
floitsch
On 2015/11/11 06:27:19, kevmoo wrote: > On 2015/11/11 06:16:03, Lasse Reichstein Nielsen wrote: > > ...
5 years, 1 month ago (2015-11-11 06:35:27 UTC) #11
kevmoo
https://confessionsofa20somethingklutz.files.wordpress.com/2014/04/sleepy-homer_lurking.gif?w=490
5 years, 1 month ago (2015-11-11 06:37:15 UTC) #12
Lasse Reichstein Nielsen
5 years, 1 month ago (2015-11-11 14:58:49 UTC) #14
Lasse Reichstein Nielsen
PTAL.
5 years, 1 month ago (2015-11-13 12:31:27 UTC) #16
Bob Nystrom
Some nits, but LGTM! https://codereview.chromium.org/1412293008/diff/20001/CHANGELOG.md File CHANGELOG.md (right): https://codereview.chromium.org/1412293008/diff/20001/CHANGELOG.md#newcode3 CHANGELOG.md:3: * Add string comparators that ...
5 years, 1 month ago (2015-11-13 16:55:36 UTC) #17
sra1
https://codereview.chromium.org/1412293008/diff/20001/lib/src/comparators.dart File lib/src/comparators.dart (right): https://codereview.chromium.org/1412293008/diff/20001/lib/src/comparators.dart#newcode26 lib/src/comparators.dart:26: const int upperCaseA = 0x41; Hoist these common constants ...
5 years, 1 month ago (2015-11-13 18:25:40 UTC) #18
Lasse Reichstein Nielsen
addressed comments, changed to real natural comparison (PTAL new code). https://codereview.chromium.org/1412293008/diff/20001/CHANGELOG.md File CHANGELOG.md (right): https://codereview.chromium.org/1412293008/diff/20001/CHANGELOG.md#newcode3 ...
5 years, 1 month ago (2015-11-18 12:12:48 UTC) #19
floitsch
LGTM. https://codereview.chromium.org/1412293008/diff/40001/lib/src/comparators.dart File lib/src/comparators.dart (right): https://codereview.chromium.org/1412293008/diff/40001/lib/src/comparators.dart#newcode125 lib/src/comparators.dart:125: int compareAsciiLowerCase(String a, String b) { How is ...
5 years, 1 month ago (2015-11-18 22:50:12 UTC) #20
sra1
lgtm https://codereview.chromium.org/1412293008/diff/40001/lib/src/comparators.dart File lib/src/comparators.dart (right): https://codereview.chromium.org/1412293008/diff/40001/lib/src/comparators.dart#newcode53 lib/src/comparators.dart:53: // Jenkins hash code ( http://en.wikipedia.org/wiki/Jenkins_hash_function). Jenkins hash ...
5 years, 1 month ago (2015-11-18 23:40:16 UTC) #21
Lasse Reichstein Nielsen
https://codereview.chromium.org/1412293008/diff/40001/lib/src/comparators.dart File lib/src/comparators.dart (right): https://codereview.chromium.org/1412293008/diff/40001/lib/src/comparators.dart#newcode10 lib/src/comparators.dart:10: const int _upperCaseZ = 0x5d; Whoops, that should be ...
5 years, 1 month ago (2015-11-19 07:15:37 UTC) #22
Lasse Reichstein Nielsen
Committed patchset #4 (id:60001) manually as c94b8dc745ef332270bece64daab7f545bf0452d (presubmit successful).
5 years, 1 month ago (2015-11-19 07:17:50 UTC) #23
kevmoo
Was going to publish this – but noticed 4 failures when running on my mac.
5 years, 1 month ago (2015-11-19 16:19:28 UTC) #24
Lasse Reichstein Nielsen
5 years, 1 month ago (2015-11-20 10:44:19 UTC) #25
Message was sent while issue was closed.
My bad. Changed the limit to exercise the test failures before committing,
forgot to save when I changed them back.

Powered by Google App Engine
This is Rietveld 408576698