Skip to content
Snippets Groups Projects
Commit a9a25388 authored by Stephan Bosch's avatar Stephan Bosch Committed by Timo Sirainen
Browse files

lib-sieve: sieve-script - Improve sieve_script_hash()

parent 31b6fa13
No related branches found
No related tags found
No related merge requests found
......@@ -441,9 +441,16 @@ int sieve_script_cmp(const struct sieve_script *script1,
unsigned int sieve_script_hash(const struct sieve_script *script)
{
i_assert(script->name != NULL);
if (script == NULL)
return 0;
unsigned int hash = 0;
hash ^= POINTER_CAST_TO(script->script_class, unsigned int);
hash ^= sieve_storage_hash(script->storage);
hash ^= str_hash(script->name);
return str_hash(script->name);
return hash;
}
/*
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment

Consent

On this website, we use the web analytics service Matomo to analyze and review the use of our website. Through the collected statistics, we can improve our offerings and make them more appealing for you. Here, you can decide whether to allow us to process your data and set corresponding cookies for these purposes, in addition to technically necessary cookies. Further information on data protection—especially regarding "cookies" and "Matomo"—can be found in our privacy policy. You can withdraw your consent at any time.