mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-12-27 20:20:40 +00:00
e24b1e8903
That's one more third party dependency down. Not only are two hashing algorithms redundant, there was also a large size discrepancy: SuperFastHash is 3 kb of source code while xxhash is 120kb and generally extremely awful code. It was easy to make a choice here. None of the use cases require this kind of performance tweaking, the longest hashed block of data is a 768 byte palette.
20 lines
358 B
C
20 lines
358 B
C
#pragma once
|
|
#include <stdint.h>
|
|
|
|
uint32_t SuperFastHash (const char *data, size_t len);
|
|
uint32_t SuperFastHashI (const char *data, size_t len);
|
|
|
|
inline unsigned int MakeKey(const char* s)
|
|
{
|
|
if (s == NULL)
|
|
{
|
|
return 0;
|
|
}
|
|
return SuperFastHashI(s, strlen(s));
|
|
}
|
|
|
|
inline unsigned int MakeKey(const char* s, size_t len)
|
|
{
|
|
return SuperFastHashI(s, len);
|
|
}
|
|
|