[fpc-pascal] How reliable are Hashlists in Contnrs
Sven Barth
pascaldragon at googlemail.com
Mon Aug 24 23:07:24 CEST 2020
Am 24.08.2020 um 21:01 schrieb Lars via fpc-pascal:
> I've noticed some problem with another hashlist that after adding
> about 2000 items to it, it starts to have problems. There are
> duplicates added (possibly a collision?)
>
> Is there a such thing as a perfect hashlist which never has a
> collision, or will they always have problems... In that case a regular
> but slower List might be of use for perfection.
>
> If there is an error would it throw an exception?
Hash lists will always create collisions if enough elements are added.
After all their purpose is to speed up the search thus they reduce the
search space. This is by design.
If there should really be a problem with adding an element then an
exception will be thrown.
Regards,
Sven
More information about the fpc-pascal
mailing list