Skip to content

Commit 2587fc7

Browse files
committed
Return immediately when writing 0 bytes
1 parent e88f452 commit 2587fc7

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lucene/core/src/java/org/apache/lucene/util/fst/GrowableByteArrayDataOutput.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@ public void writeByte(byte b) {
4545

4646
@Override
4747
public void writeBytes(byte[] b, int offset, int len) {
48+
if (len == 0) {
49+
return;
50+
}
4851
ensureCapacity(len);
4952
System.arraycopy(b, offset, bytes, nextWrite, len);
5053
nextWrite += len;

0 commit comments

Comments
 (0)