Commit 48d8031
authored
lookup slot in hash() (RustPython#6102)
* avoid get_class_attr for __hash__; read hash slot via mro_find_map
Reduce calls and lock acquisitions on hot paths by bypassing get_class_attr(__hash__) and directly resolving the hash implementation with mro_find_map(|cls| cls.slots.hash.load()).
* fix linting in hash function1 parent 0c8ae3a commit 48d8031
1 file changed
+6
-12
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
642 | 642 | | |
643 | 643 | | |
644 | 644 | | |
645 | | - | |
646 | | - | |
647 | | - | |
648 | | - | |
649 | | - | |
650 | | - | |
| 645 | + | |
| 646 | + | |
651 | 647 | | |
652 | 648 | | |
653 | | - | |
654 | | - | |
655 | | - | |
656 | | - | |
657 | | - | |
658 | | - | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
659 | 653 | | |
660 | 654 | | |
661 | 655 | | |
| |||
0 commit comments