dan1994 / dane

Training exercise in Huffman coding
0 stars 0 forks source link

Fix implementation of std::pair hash #31

Open dan1994 opened 5 years ago

dan1994 commented 5 years ago

Currently, the implementation is hash(pair.first) ^ hash(pair.second) which results in 0 for any pair that satisfies pair.first == pair.second (as @roynecro pointed out in #30).

@roynecro suggests to use hash(concat(hash(pair.first), hash(pair.second))) which will have a performance toll, but will be the most correct.