mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 14:48:21 +00:00
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:
parent
4d58b98c70
commit
10e8d36340
2 changed files with 13 additions and 36 deletions
19
src/Hash.cc
19
src/Hash.cc
|
@ -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 )
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue