Use valueOf to avoid polluting heap

This commit is contained in:
DBotThePony 2022-11-24 15:36:21 +07:00
parent d39c0d33a3
commit 096a144c53
Signed by: DBot
GPG Key ID: DCC23B5715498507

View File

@ -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 {