From 26306b528f513efc849c2f031c90f7efd99e8cda Mon Sep 17 00:00:00 2001 From: "Y. Sapir" Date: Fri, 3 May 2019 01:38:32 +0300 Subject: [PATCH] Simplify PyInt.rxor to reuse PyInt.xor --- vm/src/obj/objint.rs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/vm/src/obj/objint.rs b/vm/src/obj/objint.rs index 3687ed2b0..fdb0459af 100644 --- a/vm/src/obj/objint.rs +++ b/vm/src/obj/objint.rs @@ -296,11 +296,7 @@ impl PyInt { #[pymethod(name = "__rxor__")] fn rxor(&self, other: PyObjectRef, vm: &VirtualMachine) -> PyObjectRef { - if objtype::isinstance(&other, &vm.ctx.int_type()) { - vm.ctx.new_int(get_value(&other) ^ (&self.value)) - } else { - vm.ctx.not_implemented() - } + self.xor(other, vm) } #[pymethod(name = "__or__")]