Fix __hash__ not to perform unnecessary downcast

This commit is contained in:
Jeong YunWon
2021-10-15 05:02:13 +09:00
parent 4ede6b1510
commit 97623b4e72

View File

@@ -486,8 +486,8 @@ pub trait Hashable: PyValue {
#[inline]
#[pymethod]
fn __hash__(zelf: PyRef<Self>, vm: &VirtualMachine) -> PyResult<PyHash> {
Self::hash(&zelf, vm)
fn __hash__(zelf: PyObjectRef, vm: &VirtualMachine) -> PyResult<PyHash> {
Self::slot_hash(&zelf, vm)
}
fn hash(zelf: &PyRef<Self>, vm: &VirtualMachine) -> PyResult<PyHash>;