Commit 7484e61
Fix incorrect one-arg Base.hash method
Generated as part of an ecosystem-wide audit for one-arg hash methods.
The `hash(arg::LowerOrUpperIndex)` method only defined a one-arg
`Base.hash`, which means the two-arg fallback `hash(x, h::UInt)`
uses `objectid`-based hashing instead. This can cause correctness
issues (equal objects hashing differently) and performance problems
(excessive invalidation). With Julia 1.13+, the default hash seed
is changing from `zero(UInt)` to a random value, which will make
the one-arg method produce different results on each session.
Fix by converting to a proper two-arg method that chains the seed `h`
through the hash computation.
Co-Authored-By: Claude <noreply@anthropic.com>1 parent d5a96a8 commit 7484e61
1 file changed
Lines changed: 5 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
45 | | - | |
46 | | - | |
47 | | - | |
| 45 | + | |
| 46 | + | |
48 | 47 | | |
49 | | - | |
| 48 | + | |
50 | 49 | | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
| 50 | + | |
| 51 | + | |
55 | 52 | | |
0 commit comments