Skip to content

Commit e5c8f49

Browse files
committed
Inline single use local variable
1 parent 2bb9423 commit e5c8f49

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

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

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -886,7 +886,7 @@ CSVRecord nextRecord() throws IOException {
886886
recordList.clear();
887887
StringBuilder sb = null;
888888
final long startCharPosition = lexer.getCharacterPosition() + characterOffset;
889-
final long startBytePosition = lexer.getBytesRead() + this.characterOffset;
889+
final long startBytePosition = lexer.getBytesRead() + characterOffset;
890890
do {
891891
reusableToken.reset();
892892
lexer.nextToken(reusableToken);
@@ -919,12 +919,10 @@ CSVRecord nextRecord() throws IOException {
919919
throw new CSVException("Unexpected Token type: %s", reusableToken.type);
920920
}
921921
} while (reusableToken.type == TOKEN);
922-
923922
if (!recordList.isEmpty()) {
924923
recordNumber++;
925-
final String comment = Objects.toString(sb, null);
926-
result = new CSVRecord(this, recordList.toArray(Constants.EMPTY_STRING_ARRAY), comment,
927-
recordNumber, startCharPosition, startBytePosition);
924+
result = new CSVRecord(this, recordList.toArray(Constants.EMPTY_STRING_ARRAY), Objects.toString(sb, null), recordNumber, startCharPosition,
925+
startBytePosition);
928926
}
929927
return result;
930928
}

0 commit comments

Comments
 (0)