mirror of
https://github.com/Zygo/bees.git
synced 2025-06-17 01:56:16 +02:00
hash: prepare for user-selectable hash functions
Localize the hash function in bees to a single spot to make it easier to change later (or at runtime). Remove some code that was using a property of CRC as an optimization. The optimization doesn't work for other hash functions, and running the CRC function takes more CPU time than the optimization saved. Signed-off-by: Zygo Blaxell <bees@furryterror.org>
This commit is contained in:
@ -605,6 +605,7 @@ struct BeesHash {
|
||||
BeesHash(Type that) : m_hash(that) { }
|
||||
operator Type() const { return m_hash; }
|
||||
BeesHash& operator=(const Type that) { m_hash = that; return *this; }
|
||||
BeesHash(const uint8_t *ptr, size_t len);
|
||||
private:
|
||||
Type m_hash;
|
||||
|
||||
|
Reference in New Issue
Block a user