Skip to content

Commit 9ebd0d9

Browse files
committed
CSV-80 - CSVLexer.nextToken does not need wsBuf
remove useless wsBuf git-svn-id: https://svn.apache.org/repos/asf/commons/proper/csv/trunk@1303955 13f79535-47bb-0310-9956-ffa450edef68
1 parent 1299ddf commit 9ebd0d9

1 file changed

Lines changed: 0 additions & 7 deletions

File tree

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

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@
2323

2424
class CSVLexer extends Lexer {
2525

26-
private final StringBuilder wsBuf = new StringBuilder();
27-
2826
// ctor needs to be public so can be called dynamically by PerformanceTest class
2927
public CSVLexer(CSVFormat format, ExtendedBufferedReader in) {
3028
super(format, in);
@@ -41,7 +39,6 @@ public CSVLexer(CSVFormat format, ExtendedBufferedReader in) {
4139
*/
4240
@Override
4341
Token nextToken(Token tkn) throws IOException {
44-
wsBuf.setLength(0); // reuse
4542

4643
// get the last read char (required for empty line detection)
4744
int lastChar = in.readAgain();
@@ -84,7 +81,6 @@ Token nextToken(Token tkn) throws IOException {
8481
// ignore whitespaces at beginning of a token
8582
if (leadingSpacesIgnored) {
8683
while (isWhitespace(c) && !eol) {
87-
wsBuf.append((char) c);
8884
c = in.read();
8985
eol = isEndOfLine(c);
9086
}
@@ -115,9 +111,6 @@ Token nextToken(Token tkn) throws IOException {
115111
} else {
116112
// next token must be a simple token
117113
// add removed blanks when not ignoring whitespace chars...
118-
if (!leadingSpacesIgnored) {
119-
tkn.content.append(wsBuf);
120-
}
121114
simpleTokenLexer(tkn, c);
122115
}
123116
}

0 commit comments

Comments
 (0)