Skip to content

Commit 6838c41

Browse files
committed
Fix condition where subtraction can overflow
1 parent 20cdd0c commit 6838c41

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

library/src/scala/collection/immutable/Vector.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ private sealed abstract class VectorImpl[+A](_prefix1: Arr1) extends Vector[A](_
286286
val hi = mmin(until, length)
287287
val newlen = hi - lo
288288
if(newlen == length) this
289-
else if(newlen <= 0) Vector0
289+
else if(hi <= lo) Vector0
290290
else slice0(lo, hi)
291291
}
292292
}

0 commit comments

Comments
 (0)