set: introduce set_put_strndup()
authorYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 15 Jun 2022 16:20:20 +0000 (01:20 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 17 Jun 2022 03:28:36 +0000 (12:28 +0900)
commitcb649d12bf3283974305c98ecf51e4bf7596a8bf
tree1b7957b409f415d83058803306a28a803d72d2d5
parent1008d415e7054e206354fa54c61e4020f6f7573e
set: introduce set_put_strndup()

Note, if `n != SIZE_MAX`, we cannot check the existence of the specified
string in the set without duplicating the string. And, set_consume() also
checks the existence of the string. Hence, it is not necessary to call
set_contains() if `n != SIZE_MAX`.
src/basic/hashmap.c
src/basic/set.h
src/test/test-set.c