1
0
mirror of https://github.com/wolfpld/tracy.git synced 2025-03-20 07:40:02 +08: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
+2 -2
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;