mirror of
https://github.com/RustPython/RustPython.git
synced 2026-10-29 03:04:38 +08:00
Simplify PyInt.rxor to reuse PyInt.xor
This commit is contained in:
1 parent
8f3b62ba0e
commit
26306b528f
1 file changed
+1
-5
@@ -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__")]
|
||||
|
||||
Reference in new issue
Block a user