Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HTAdd silently accepts adding the same key again, adds into new slot #30

Open
fingolfin opened this issue Jul 5, 2017 · 0 comments
Open
Labels

Comments

@fingolfin
Copy link
Member

Example:

gap> SetInfoLevel(InfoOrb, 3);
gap> ht := HTCreate(1, rec(hashlen:=5));
<hash table obj len=5 used=0 colls=0 accs=0 (can grow)>
gap> ht := HTCreate(1, rec(hashlen:=3));
<hash table obj len=3 used=0 colls=0 accs=0 (can grow)>
gap> HTAdd(ht,1,1);; HTValue(ht, 1);
1
gap> HTAdd(ht,1,2);; HTValue(ht, 1);
1
gap> HTAdd(ht,1,3);; HTValue(ht, 1);
1
gap> HTAdd(ht,1,4);; HTValue(ht, 1);
#I  Hash table too full, growing...
#I  Growing hash table to length 11 !!!
#I  Done.
2

Expected behaviour: I would expect HTAdd to report an error; or at least warning, and then drop the new value. Alternatively, it could also update (which then render HTUpdate obsolete)

@fingolfin fingolfin added the bug label Jul 5, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant