Message31107
The whole point of a hash is that if it doesn't match, you can skip an expensive comparison. How big to make the hash is a tradeoff between how much you'll waste calculating and storing it vs how often it will save a "real" comparison.
The comment means that, as an implementation detail, popitem assumes it can store a pointer there instead, so hashes need to be at least as big as a pointer.
Going to the larger of the two sizes will certainly solve your problem; it just wastes some space, and maybe some time calculating the hash.
If you want to get that space back, just make sure the truncation is correct and consistent. I *suspect* your problem is that when there is a collision, either
(1) It is comparing a truncated value to an untruncated value, or
(2) The perturbation to find the next slot is going wrong, because of when the truncation happens. |
|
Date |
User |
Action |
Args |
2007-08-23 14:51:34 | admin | link | issue1646068 messages |
2007-08-23 14:51:34 | admin | create | |
|