1
0
mirror of https://github.com/wolfpld/tracy synced 2025-04-30 12:53:51 +00:00

Make callstack hash less shitty.

This commit is contained in:
Bartosz Taudul 2018-06-24 17:30:54 +02:00
parent ab2945b988
commit d7a85983a5

View File

@ -20,10 +20,10 @@ public:
: m_size( size ) : m_size( size )
, m_ptr( data ) , m_ptr( data )
{ {
T hash = 0; T hash = 5381;
for( uint8_t i=0; i<size; i++ ) for( uint8_t i=0; i<size; i++ )
{ {
hash += data[i]; hash = ( ( hash << 5 ) + hash ) ^ data[i];
} }
m_hash = uint32_t( hash ); m_hash = uint32_t( hash );
} }