File tree 1 file changed +4
-10
lines changed 1 file changed +4
-10
lines changed Original file line number Diff line number Diff line change @@ -233,20 +233,14 @@ object Liftable {
233
233
}
234
234
235
235
given as Liftable [BigInt ] = new Liftable [BigInt ] {
236
- def toExpr (x : BigInt ): given QuoteContext => Expr [BigInt ] = {
237
- lazy val xInt : Int = x.intValue()
238
- if (x.isValidInt && - 1024 <= xInt && xInt < 1024 ) ' { BigInt ($ {xInt.toExpr}) } // Cached BigInt
239
- else ' { BigInt ($ {x.toString(Character .MAX_RADIX ).toExpr}, $ {Character .MAX_RADIX .toExpr}) } // Compact string BigInt
240
- }
236
+ def toExpr (x : BigInt ): given QuoteContext => Expr [BigInt ] =
237
+ ' { BigInt ($ {x.toString(Character .MAX_RADIX ).toExpr}, $ {Character .MAX_RADIX .toExpr}) }
241
238
}
242
239
243
240
/** Lift a BigDecimal using the default MathContext */
244
241
given as Liftable [BigDecimal ] = new Liftable [BigDecimal ] {
245
- def toExpr (x : BigDecimal ): given QuoteContext => Expr [BigDecimal ] = {
246
- lazy val xInt : Int = x.intValue()
247
- if (x.isValidInt && - 512 <= xInt && xInt < 512 ) ' { BigDecimal ($ {xInt.toExpr}) } // Cached BigDecimal
248
- else ' { BigDecimal ($ {x.toString.toExpr}) }
249
- }
242
+ def toExpr (x : BigDecimal ): given QuoteContext => Expr [BigDecimal ] =
243
+ ' { BigDecimal ($ {x.toString.toExpr}) }
250
244
}
251
245
252
246
}
You can’t perform that action at this time.
0 commit comments