Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: jruby/jruby
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: f248488f6a76
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: eb491e52d68b
Choose a head ref
  • 2 commits
  • 2 files changed
  • 1 contributor

Commits on Apr 18, 2018

  1. fix old String#casecmp impl

    lopex committed Apr 18, 2018

    Verified

    This commit was signed with the committer’s verified signature.
    wyattjoh Wyatt Johnson
    Copy the full SHA
    081a382 View commit details
  2. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    eb491e5 View commit details
Showing with 11 additions and 9 deletions.
  1. +11 −8 core/src/main/java/org/jruby/util/StringSupport.java
  2. +0 −1 test/mri/excludes/TestUTF16.rb
19 changes: 11 additions & 8 deletions core/src/main/java/org/jruby/util/StringSupport.java
Original file line number Diff line number Diff line change
@@ -2110,18 +2110,21 @@ public static int multiByteCasecmp(Encoding enc, ByteList value, ByteList otherV
oc = preciseCodePoint(enc, obytes, op, oend);
}

int cl, ocl;
if (enc.isAsciiCompatible() && Encoding.isAscii(c) && Encoding.isAscii(oc)) {
byte uc = AsciiTables.ToUpperCaseTable[c];
byte uoc = AsciiTables.ToUpperCaseTable[oc];
if (uc != uoc) {
return uc < uoc ? -1 : 1;
final int cl, ocl;
if (Encoding.isAscii(c) && Encoding.isAscii(oc)) {
int dc = AsciiTables.ToUpperCaseTable[c];
int odc = AsciiTables.ToUpperCaseTable[oc];
if (dc != odc) return dc < odc ? -1 : 1;

if (enc.isAsciiCompatible()) {
cl = ocl = 1;
} else {
cl = preciseLength(enc, bytes, p, end);
ocl = preciseLength(enc, obytes, op, oend);
}
cl = ocl = 1;
} else {
cl = length(enc, bytes, p, end);
ocl = length(enc, obytes, op, oend);
// TODO: opt for 2 and 3 ?
int ret = caseCmp(bytes, p, obytes, op, cl < ocl ? cl : ocl);
if (ret != 0) return ret < 0 ? -1 : 1;
if (cl != ocl) return cl < ocl ? -1 : 1;
1 change: 0 additions & 1 deletion test/mri/excludes/TestUTF16.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
exclude :test_casecmp2, "needs investigation"
exclude :test_regexp_union, "needs investigation"
exclude :test_succ, "very slow...takes 40 seconds"
exclude :test_sym_eq, "needs investigation"