mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-03 03:20:57 +00:00
stasis: Reduce calculation of stasis message type hash.
When the stasis cache is used a hash is calculated for retrieving or inserting messages. This change calculates a hash when the message type is initialized that is then used each time needed. This ensures that the hash is calculated only once for the message type. Change-Id: I4fe6bfdafb55bf5c322dd313fbd8c32cce73ef37
This commit is contained in:
@@ -174,7 +174,7 @@ static void cache_entry_dtor(void *obj)
|
||||
|
||||
static void cache_entry_compute_hash(struct cache_entry_key *key)
|
||||
{
|
||||
key->hash = ast_hashtab_hash_string(stasis_message_type_name(key->type));
|
||||
key->hash = stasis_message_type_hash(key->type);
|
||||
key->hash += ast_hashtab_hash_string(key->id);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user