1
0
mirror of https://github.com/wolfpld/tracy synced 2025-04-29 04:23:51 +00:00

Skip comparing known to be matching memory.

This commit is contained in:
Bartosz Taudul 2021-10-30 01:26:31 +02:00
parent 1ecdb8aa2a
commit 8b15cd049c
No known key found for this signature in database
GPG Key ID: B7FE2008B7575DF3

View File

@ -1435,7 +1435,7 @@ static inline void AdvanceTo( const char*& line, const char* match )
{
auto bit = __builtin_ctz( b );
auto test = ptr + bit;
if( memcmp( test, match, S ) == 0 )
if( memcmp( test + 1, match + 1, S - 1 ) == 0 )
{
line = test;
return;
@ -1459,7 +1459,7 @@ static inline void AdvanceTo( const char*& line, const char* match )
{
if( ( l & 0xFF ) == first )
{
if( memcmp( ptr + i, match, S ) == 0 )
if( memcmp( ptr + i + 1, match + 1, S - 1 ) == 0 )
{
line = ptr + i;
return;