We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 8084294 + 82c4ed1 commit ead6684Copy full SHA for ead6684
library/src/scala/collection/immutable/Range.scala
@@ -373,11 +373,11 @@ sealed abstract class Range(
373
if (x == end && !isInclusive) false
374
else if (step > 0) {
375
if (x < start || x > end) false
376
- else (step == 1) || (((x - start) % step) == 0)
+ else (step == 1) || (Integer.remainderUnsigned(x - start, step) == 0)
377
}
378
else {
379
if (x < end || x > start) false
380
- else (step == -1) || (((x - start) % step) == 0)
+ else (step == -1) || (Integer.remainderUnsigned(start - x, -step) == 0)
381
382
383
/* Seq#contains has a type parameter so the optimised contains above doesn't override it */
0 commit comments