mirror of
https://github.com/wolfpld/tracy.git
synced 2025-03-20 07:40:02 +08:00
Prevent source location payload duplication.
This commit is contained in:
@@ -23,6 +23,21 @@ static inline uint32_t hash( const char* str )
|
||||
return hash;
|
||||
}
|
||||
|
||||
static inline uint32_t hash( const char* str, size_t sz )
|
||||
{
|
||||
uint32_t hash = 5381;
|
||||
int c;
|
||||
|
||||
while( sz > 0 )
|
||||
{
|
||||
c = *str++;
|
||||
hash = ( ( hash << 5 ) + hash ) ^ c;
|
||||
sz--;
|
||||
}
|
||||
|
||||
return hash;
|
||||
}
|
||||
|
||||
struct Hasher
|
||||
{
|
||||
size_t operator()( const char* key ) const
|
||||
|
||||
Reference in New Issue
Block a user