Use valueOf to avoid polluting heap
This commit is contained in:
parent
d39c0d33a3
commit
096a144c53
@ -407,7 +407,7 @@ class ImpreciseFraction @JvmOverloads constructor(whole: BigInteger, decimal: Do
|
||||
return this
|
||||
}
|
||||
|
||||
return plus(ImpreciseFraction(other))
|
||||
return plus(valueOf(other))
|
||||
}
|
||||
|
||||
operator fun minus(other: Int): ImpreciseFraction {
|
||||
@ -415,7 +415,7 @@ class ImpreciseFraction @JvmOverloads constructor(whole: BigInteger, decimal: Do
|
||||
return this
|
||||
}
|
||||
|
||||
return minus(ImpreciseFraction(other))
|
||||
return minus(valueOf(other))
|
||||
}
|
||||
|
||||
operator fun times(other: Int): ImpreciseFraction {
|
||||
@ -427,7 +427,7 @@ class ImpreciseFraction @JvmOverloads constructor(whole: BigInteger, decimal: Do
|
||||
return -this
|
||||
}
|
||||
|
||||
return times(ImpreciseFraction(other))
|
||||
return times(valueOf(other))
|
||||
}
|
||||
|
||||
operator fun div(other: Int): ImpreciseFraction {
|
||||
@ -442,7 +442,7 @@ class ImpreciseFraction @JvmOverloads constructor(whole: BigInteger, decimal: Do
|
||||
return -this
|
||||
}
|
||||
|
||||
return div(ImpreciseFraction(other))
|
||||
return div(valueOf(other))
|
||||
}
|
||||
|
||||
operator fun plus(other: Long): ImpreciseFraction {
|
||||
@ -450,7 +450,7 @@ class ImpreciseFraction @JvmOverloads constructor(whole: BigInteger, decimal: Do
|
||||
return this
|
||||
}
|
||||
|
||||
return plus(ImpreciseFraction(other))
|
||||
return plus(valueOf(other))
|
||||
}
|
||||
|
||||
operator fun minus(other: Long): ImpreciseFraction {
|
||||
@ -458,7 +458,7 @@ class ImpreciseFraction @JvmOverloads constructor(whole: BigInteger, decimal: Do
|
||||
return this
|
||||
}
|
||||
|
||||
return minus(ImpreciseFraction(other))
|
||||
return minus(valueOf(other))
|
||||
}
|
||||
|
||||
operator fun times(other: Long): ImpreciseFraction {
|
||||
@ -470,7 +470,7 @@ class ImpreciseFraction @JvmOverloads constructor(whole: BigInteger, decimal: Do
|
||||
return -this
|
||||
}
|
||||
|
||||
return times(ImpreciseFraction(other))
|
||||
return times(valueOf(other))
|
||||
}
|
||||
|
||||
operator fun div(other: Long): ImpreciseFraction {
|
||||
@ -485,7 +485,7 @@ class ImpreciseFraction @JvmOverloads constructor(whole: BigInteger, decimal: Do
|
||||
return -this
|
||||
}
|
||||
|
||||
return div(ImpreciseFraction(other))
|
||||
return div(valueOf(other))
|
||||
}
|
||||
|
||||
operator fun plus(other: BigInteger): ImpreciseFraction {
|
||||
|
Loading…
Reference in New Issue
Block a user