Skip to content

Commit 31b702c

Browse files
committed
Performance Enhancement: Call toArray with Zero Array Size
1 parent 13c539a commit 31b702c

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/main/java/org/apache/commons/csv/CSVParser.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -620,7 +620,7 @@ CSVRecord nextRecord() throws IOException {
620620
if (!this.recordList.isEmpty()) {
621621
this.recordNumber++;
622622
final String comment = sb == null ? null : sb.toString();
623-
result = new CSVRecord(this.recordList.toArray(new String[this.recordList.size()]), this.headerMap, comment,
623+
result = new CSVRecord(this.recordList.toArray(new String[0]), this.headerMap, comment,
624624
this.recordNumber, startCharPosition);
625625
}
626626
return result;

0 commit comments

Comments
 (0)