Skip to content

Commit 86b6ae3

Browse files
committed
optimize BAIS.hasNext
1 parent 80ffb00 commit 86b6ae3

File tree

1 file changed

+2
-1
lines changed
  • src/main/java/com/trivago/fastutilconcurrentwrapper/io

1 file changed

+2
-1
lines changed

src/main/java/com/trivago/fastutilconcurrentwrapper/io/BAIS.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,8 @@ public String readLatin1String (@PositiveOrZero int strLen) {
287287

288288
@Override
289289
public boolean hasNext () {
290-
return available() > 0;
290+
// available() > 0 == (length - position) > 0
291+
return pos < count;
291292
}
292293

293294
@Override

0 commit comments

Comments
 (0)