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: dd733e43fd07
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 8f973b7c6c1f
Choose a head ref
  • 3 commits
  • 3 files changed
  • 1 contributor

Commits on Mar 24, 2015

  1. Unbreak a few items from fixing.

    * Encode ascii codepoints for Array#inspect using target enc.
    * Encoding.prevCodeHead returns -1 for us, since no pointers.
    headius committed Mar 24, 2015
    Copy the full SHA
    cecae9c View commit details
  2. Copy the full SHA
    54d68b1 View commit details
  3. Reduce verbosity.

    headius committed Mar 24, 2015
    Copy the full SHA
    8f973b7 View commit details
Showing with 8 additions and 8 deletions.
  1. +2 −2 core/src/main/java/org/jruby/RubyArray.java
  2. +0 −1 core/src/main/java/org/jruby/RubyString.java
  3. +6 −5 core/src/main/java/org/jruby/util/StringSupport.java
4 changes: 2 additions & 2 deletions core/src/main/java/org/jruby/RubyArray.java
Original file line number Diff line number Diff line change
@@ -1448,12 +1448,12 @@ private IRubyObject inspectAry(ThreadContext context) {

RubyString s = inspect(context, safeArrayRef(values, begin + i));
if (s.isTaint()) tainted = true;
if (i > 0) str.cat(',', UTF16BEEncoding.INSTANCE).cat(' ', UTF16BEEncoding.INSTANCE);
if (i > 0) str.cat(',', encoding).cat(' ', encoding);
else str.setEncoding(s.getEncoding());

str.cat19(s);
}
str.cat(']', UTF16BEEncoding.INSTANCE);
str.cat(']', encoding);

if (tainted) str.setTaint(true);

1 change: 0 additions & 1 deletion core/src/main/java/org/jruby/RubyString.java
Original file line number Diff line number Diff line change
@@ -4436,7 +4436,6 @@ public IRubyObject count19(ThreadContext context) {
@JRubyMethod(name = "count")
public IRubyObject count19(ThreadContext context, IRubyObject arg) {
Ruby runtime = context.runtime;
if (value.getRealSize() == 0) return RubyFixnum.zero(runtime);

RubyString otherStr = arg.convertToString();
ByteList otherBL = otherStr.getByteList();
11 changes: 6 additions & 5 deletions core/src/main/java/org/jruby/util/StringSupport.java
Original file line number Diff line number Diff line change
@@ -1125,10 +1125,11 @@ public static ByteList succCommon(ByteList original) {
boolean alnumSeen = false;
while ((s = enc.prevCharHead(bytes, p, s, end)) != -1) {
if (neighbor == NeighborChar.NOT_CHAR && lastAlnum != -1) {
if (ASCIIEncoding.INSTANCE.isAlpha(bytes[lastAlnum] & 0xff) ?
ASCIIEncoding.INSTANCE.isDigit(bytes[s] & 0xff) :
ASCIIEncoding.INSTANCE.isDigit(bytes[lastAlnum] & 0xff) ?
ASCIIEncoding.INSTANCE.isAlpha(bytes[s] & 0xff) : false) {
ASCIIEncoding ascii = ASCIIEncoding.INSTANCE;
if (ascii.isAlpha(bytes[lastAlnum] & 0xff) ?
ascii.isDigit(bytes[s] & 0xff) :
ascii.isDigit(bytes[lastAlnum] & 0xff) ?
ascii.isAlpha(bytes[s] & 0xff) : false) {
s = lastAlnum;
break;
}
@@ -1447,7 +1448,7 @@ public static int choppedLength19(CodeRangeable str, Ruby runtime) {
if (p == 0) return 0;
if (p > beg && EncodingUtils.encAscget(bl.unsafeBytes(), p, end, null, enc) == '\n') {
p2 = enc.prevCharHead(bl.unsafeBytes(), beg, p, end);
if (p2 != 0 && EncodingUtils.encAscget(bl.unsafeBytes(), p2, end, null, enc) == '\r') p = p2;
if (p2 != -1 && EncodingUtils.encAscget(bl.unsafeBytes(), p2, end, null, enc) == '\r') p = p2;
}
return p - beg;
}