Re: generic container for sets

2018-12-11 Thread Bruno Haible
These *-set patches introduced a bit of code duplication. This patch here reduces the code duplication again. 2018-12-11 Bruno Haible hash-set, linkedhash-set: Reduce code duplication. * lib/gl_anyhash1.h: Rename from lib/gl_anyhash_list1.h and lib/gl_anyhash_set1.h.

Re: generic container for sets

2018-12-11 Thread Bruno Haible
A small optimization. 2018-12-11 Bruno Haible array-set: Optimize. * lib/gl_array_set.c (gl_array_search, gl_array_remove): Test equals_fn outside the loop, not inside the loop. diff --git a/lib/gl_array_set.c b/lib/gl_array_set.c index dd77ef1..8e985af 100644 --- a/l

Re: generic container for sets

2018-12-11 Thread Bruno Haible
Oops, I made a wrong use of qsort() in the tests. This should fix it. 2018-12-11 Bruno Haible array-set, linkedhash-set, hash-set: Fix tests. * tests/test-array_set.c (cmp_objects_in_array): New function. (check_equals): Use it. * tests/test-hash_set.c: Likewis

Re: generic container for sets

2018-12-07 Thread Bruno Haible
There were no comments. So I pushed this. Bruno

generic container for sets

2018-12-03 Thread Bruno Haible
Hi, In gnulib, so far, we have generic containers for the abstract concepts of - list, - ordered set. This proposed series of patches adds a container for - set. The difference between "ordered set" and "set" is that for ordered set, there is a comparison function that introduces a total or