Skip to content

Commit

Permalink
[Truffle] String#scrub remove byte list from impl
Browse files Browse the repository at this point in the history
  • Loading branch information
Brandon Fish committed Jan 8, 2017
1 parent 421be6d commit d28f883
Showing 1 changed file with 7 additions and 10 deletions.
Expand Up @@ -1394,7 +1394,6 @@ public DynamicObject scrubDefault(VirtualFrame frame, DynamicObject string, Obje
@Cached("createBinaryProfile()") ConditionProfile asciiCompatibleProfile) {
final DynamicObject rubyEncoding = getContext().getEncodingManager().getRubyEncoding(StringOperations.encoding(string));
final Rope rope = rope(string);
final ByteList value = RopeOperations.getByteListReadOnly(rope);
Rope buf = null;
CodeRange cr = rope.getCodeRange();
final Encoding enc;
Expand All @@ -1416,12 +1415,12 @@ public DynamicObject scrubDefault(VirtualFrame frame, DynamicObject string, Obje
}
encidx = enc;

if (asciiCompatibleProfile.profile(enc.isAsciiCompatible())) {
final byte[] pBytes = value.unsafeBytes();
int p = value.begin();
final int e = p + value.getRealSize();
int p1 = p;
final byte[] pBytes = rope.getBytes();
final int e = pBytes.length;

if (asciiCompatibleProfile.profile(enc.isAsciiCompatible())) {
int p = 0;
int p1 = 0;
final byte[] repBytes;
final int replen;
final boolean rep7bit_p;
Expand Down Expand Up @@ -1540,10 +1539,8 @@ else if (MBCLEN_INVALID_P(ret)) {
}
else {
/* ASCII incompatible */
final byte[] pBytes = value.unsafeBytes();
int p = value.begin();
final int e = p + value.getRealSize();
int p1 = p;
int p = 0;
int p1 = 0;
final int mbminlen = enc.minLength();

final byte[] repBytes;
Expand Down

0 comments on commit d28f883

Please sign in to comment.