logoalt Hacker News

Sesse__12/08/20241 replyview on HN

I would assume that is because the hash table takes in a “hash this key” function pointer and a “compare these keys” function pointer, and those must contain the size for variable-length keys. So even if your user-supplied functions know the length, or only care about the first byte, they have to conform to that API, and then you get an unused parameter.


Replies

zabzonk12/08/2024

Have functions with different names and different numbers of parameters?

show 3 replies