Remove unused HashKey constructor and reorder for consistency

One of the HashKey constructors was only used in the old CompHash code.
This aso reorders some constructors and the destructor for readability.
This commit is contained in:
Christian Kreibich 2021-09-16 17:19:55 -07:00
parent 4d58b98c70
commit 10e8d36340
2 changed files with 13 additions and 36 deletions

View file

@ -161,17 +161,11 @@ HashKey::HashKey(const String* s)
key = (char*)s->Bytes();
}
HashKey::HashKey(int copy_key, void* arg_key, size_t arg_size)
HashKey::HashKey(const void* bytes, size_t arg_size)
{
size = write_size = arg_size;
if ( copy_key )
{
key = new char[size]; // s == 0 is okay, returns non-nil
memcpy(key, arg_key, size);
}
else
key = (char*)arg_key;
key = CopyKey((char*)bytes, size);
is_our_dynamic = true;
}
HashKey::HashKey(const void* arg_key, size_t arg_size, hash_t arg_hash)
@ -189,13 +183,6 @@ HashKey::HashKey(const void* arg_key, size_t arg_size, hash_t arg_hash, bool /*
key = (char*)arg_key;
}
HashKey::HashKey(const void* bytes, size_t arg_size)
{
size = write_size = arg_size;
key = CopyKey((char*)bytes, size);
is_our_dynamic = true;
}
hash_t HashKey::Hash() const
{
if ( hash == 0 )