Skip to content

Commit aae0719

Browse files
committed
Fix nonsensical code in SemanticDB
1 parent 42e0363 commit aae0719

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

compiler/src/dotty/tools/dotc/semanticdb/internal/SemanticdbInputStream.scala

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -143,8 +143,7 @@ class SemanticdbInputStream private (buffer: Array[Byte], input: InputStream) {
143143
throw new IllegalStateException(
144144
s"refillBuffer() called when $n bytes were already available in buffer")
145145
}
146-
if (totalBytesRetired + bufferPos + n > currentLimit) false
147-
else if (input != null) {
146+
if totalBytesRetired + bufferPos + n <= currentLimit && input != null then
148147
val pos: Int = bufferPos
149148
if (pos > 0) {
150149
if (bufferSize > pos) {
@@ -166,7 +165,6 @@ class SemanticdbInputStream private (buffer: Array[Byte], input: InputStream) {
166165
recomputeBufferSizeAfterLimit()
167166
return ((bufferSize >= n) || tryRefillBuffer(n))
168167
}
169-
}
170168
false
171169
}
172170

0 commit comments

Comments
 (0)