Commit ce1cb9f
committed
fix: initialize seed and reset state in PYXXH32_new and PYXXH64_new
For consistency with XXH3_64 and XXH3_128 implementations, tp_new now
initializes self->seed = 0 and resets the internal state. This ensures
the object is in a valid state even if __init__ is bypassed (e.g. via
__new__ directly or subclassing without calling super().__init__).1 parent b2698c2 commit ce1cb9f
1 file changed
Lines changed: 6 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
415 | 415 | | |
416 | 416 | | |
417 | 417 | | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
418 | 421 | | |
419 | 422 | | |
420 | 423 | | |
| |||
719 | 722 | | |
720 | 723 | | |
721 | 724 | | |
| 725 | + | |
| 726 | + | |
| 727 | + | |
722 | 728 | | |
723 | 729 | | |
724 | 730 | | |
| |||
0 commit comments