Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Truffle] Removing a ByteList from String#scrub impl
Browse files Browse the repository at this point in the history
Brandon Fish committed Jan 7, 2017
1 parent baea383 commit ca6d23f
Showing 1 changed file with 6 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1434,10 +1434,9 @@ public DynamicObject scrubDefault(VirtualFrame frame, DynamicObject string, Obje
}
else if (repl != nil()) {
final Rope replRope = rope((DynamicObject) repl);
final ByteList replValue = RopeOperations.getByteListReadOnly(replRope);
repBytes = replValue.unsafeBytes();
rep = replValue.begin();
replen = replValue.getRealSize();
repBytes = replRope.getBytesCopy();
rep = 0;
replen = repBytes.length;
rep7bit_p = (replRope.getCodeRange() == CodeRange.CR_7BIT);
}
else if (encidx == UTF8Encoding.INSTANCE) {
@@ -1556,10 +1555,9 @@ else if (MBCLEN_INVALID_P(ret)) {
int mbminlen = enc.minLength();
if (repl != nil()) {
final Rope replRope = rope((DynamicObject) repl);
final ByteList replValue = RopeOperations.getByteListReadOnly(replRope);
repBytes = replValue.unsafeBytes();
rep = replValue.begin();
replen = replValue.getRealSize();
repBytes = replRope.getBytesCopy();
rep = 0;
replen = repBytes.length;
}
else if (encidx == UTF16BEEncoding.INSTANCE) {
repBytes = SCRUB_REPL_UTF16BE;

0 comments on commit ca6d23f

Please sign in to comment.