(&self, a: &BigInt, b: &BigInt, vm: &VirtualMachine)
| 7095 | /// Int subtraction with i64 fast path to avoid BigInt heap allocation. |
| 7096 | #[inline] |
| 7097 | fn int_sub(&self, a: &BigInt, b: &BigInt, vm: &VirtualMachine) -> PyObjectRef { |
| 7098 | use num_traits::ToPrimitive; |
| 7099 | if let (Some(av), Some(bv)) = (a.to_i64(), b.to_i64()) |
| 7100 | && let Some(result) = av.checked_sub(bv) |
| 7101 | { |
| 7102 | return vm.ctx.new_int(result).into(); |
| 7103 | } |
| 7104 | vm.ctx.new_int(a - b).into() |
| 7105 | } |
| 7106 | |
| 7107 | #[cold] |
| 7108 | fn setup_annotations(&mut self, vm: &VirtualMachine) -> FrameResult { |