CSV-279: Optimize Lexer Delimiter Check for One Character Delimiter (#163)
This commit is contained in:
parent
cdbc8925d9
commit
f7c067d9b2
|
@ -123,6 +123,9 @@ final class Lexer implements Closeable {
|
||||||
if (ch != delimiter[0]) {
|
if (ch != delimiter[0]) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
if (delimiter.length == 1) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
final int len = delimiter.length - 1;
|
final int len = delimiter.length - 1;
|
||||||
final char[] buf = reader.lookAhead(len);
|
final char[] buf = reader.lookAhead(len);
|
||||||
for (int i = 0; i < len; i++) {
|
for (int i = 0; i < len; i++) {
|
||||||
|
|
Loading…
Reference in New Issue