Simplified nonNegativeMod to match previous version
This commit is contained in:
parent
d4556f4207
commit
12553e5c55
|
@ -596,7 +596,7 @@ private object Utils extends Logging {
|
||||||
output.toString
|
output.toString
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A regular expression to match classes of the "core" Spark API that we want to skip when
|
* A regular expression to match classes of the "core" Spark API that we want to skip when
|
||||||
* finding the call site of a method.
|
* finding the call site of a method.
|
||||||
*/
|
*/
|
||||||
|
@ -763,6 +763,6 @@ private object Utils extends Logging {
|
||||||
*/
|
*/
|
||||||
def nonNegativeMod(x: Int, mod: Int): Int = {
|
def nonNegativeMod(x: Int, mod: Int): Int = {
|
||||||
val rawMod = x % mod
|
val rawMod = x % mod
|
||||||
rawMod + (if (x < 0 && rawMod != 0) mod else 0)
|
rawMod + (if (rawMod < 0) mod else 0)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue