Skip to content

Commit

Permalink
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -56,6 +56,7 @@ public class RopeOperations {

private static final ConcurrentHashMap<Encoding, Charset> encodingToCharsetMap = new ConcurrentHashMap<>();

@TruffleBoundary
public static LeafRope create(byte[] bytes, Encoding encoding, CodeRange codeRange) {
if (bytes.length == 1) {
final int index = bytes[0] & 0xff;
@@ -89,7 +90,6 @@ public static LeafRope create(byte[] bytes, Encoding encoding, CodeRange codeRan
case CR_VALID: return new ValidLeafRope(bytes, encoding, characterLength);
case CR_BROKEN: return new InvalidLeafRope(bytes, encoding);
default: {
CompilerDirectives.transferToInterpreterAndInvalidate();
throw new RuntimeException(StringUtils.format("Unknown code range type: %d", codeRange));
}
}
Original file line number Diff line number Diff line change
@@ -128,7 +128,7 @@ public abstract static class CreateSimpleStringNode extends CoreMethodArrayArgum

@Specialization
public DynamicObject createSimpleString() {
return createString(RopeOperations.create(new byte[]{'t', 'e', 's', 't'}, UTF8Encoding.INSTANCE, CodeRange.CR_7BIT));
return createString(new AsciiOnlyLeafRope(new byte[]{'t', 'e', 's', 't'}, UTF8Encoding.INSTANCE));
}
}

0 comments on commit 7142171

Please sign in to comment.