Skip to content

Commit

Permalink
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions core/src/main/java/org/jruby/RubyString.java
Original file line number Diff line number Diff line change
@@ -739,9 +739,9 @@ public static RubyString newUsAsciiStringShared(Ruby runtime, ByteList bytes) {
}

public static RubyString newUsAsciiStringShared(Ruby runtime, byte[] bytes, int start, int length) {
byte[] copy = new byte[length];
System.arraycopy(bytes, start, copy, 0, length);
return newUsAsciiStringShared(runtime, new ByteList(copy, false));
RubyString str = newUsAsciiStringNoCopy(runtime, new ByteList(bytes, start, length, false));
str.shareLevel = SHARE_LEVEL_BUFFER;
return str;
}

@Override

0 comments on commit 538b5e0

Please sign in to comment.