Code cleanup

This commit is contained in:
Pierre Pronchery 2009-08-04 00:02:40 +00:00
parent 375c364345
commit 1556118b7e

View File

@ -72,30 +72,6 @@ struct _Hash
};
/* functions */
/* hash_func_string */
unsigned int hash_func_string(void const * key)
{
String const * str = key;
size_t i;
unsigned int hash = 0;
for(i = 0; i < sizeof(hash) && str[i] != '\0'; i++)
hash |= str[i] << (i << 3);
return hash;
}
/* hash_compare_string */
int hash_compare_string(void const * value1, void const * value2)
{
String const * str1 = value1;
String const * str2 = value2;
return string_compare(str1, str2);
}
/* public */
/* functions */
/* hash_new */
@ -129,6 +105,30 @@ void hash_delete(Hash * hash)
}
/* helpers */
/* hash_func_string */
unsigned int hash_func_string(void const * key)
{
String const * str = key;
size_t i;
unsigned int hash = 0;
for(i = 0; i < sizeof(hash) && str[i] != '\0'; i++)
hash |= str[i] << (i << 3);
return hash;
}
/* hash_compare_string */
int hash_compare_string(void const * value1, void const * value2)
{
String const * str1 = value1;
String const * str2 = value2;
return string_compare(str1, str2);
}
/* accessors */
/* hash_get */
void * hash_get(Hash * hash, void const * key)