Skip to content

Commit

Permalink
Clear position when putting without offset
Browse files Browse the repository at this point in the history
Moving to Java 13+ would allow us to do absolute puts without the
position changing.
  • Loading branch information
headius committed Oct 3, 2023
1 parent 8dd2bd5 commit 94771e5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/src/main/java/org/jruby/RubyIOBuffer.java
Original file line number Diff line number Diff line change
Expand Up @@ -1300,8 +1300,8 @@ private void bufferCopy(ThreadContext context, int offset, ByteList sourceBuffer
} else {
destBuffer.position(offset);
destBuffer.put(sourceBuffer.getUnsafeBytes(), sourceBuffer.begin() + sourceOffset, length);
destBuffer.clear();
}
destBuffer.clear();
}

@JRubyMethod(name = "get_string")
Expand Down

0 comments on commit 94771e5

Please sign in to comment.