Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/wolfpld/tracy.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBartosz Taudul <wolf@nereid.pl>2022-10-15 01:42:01 +0300
committerBartosz Taudul <wolf@nereid.pl>2022-10-15 01:42:01 +0300
commit564534c7036f96790e299e962120e547079bfc25 (patch)
treeee08e330e98a6e936817df48d341541307dcf19f
parent47ec7de47904706034b4351cf0ebafe4b412eb7e (diff)
Perform fast integer comparison before comparing strings.
-rw-r--r--server/TracySourceView.cpp48
1 files changed, 24 insertions, 24 deletions
diff --git a/server/TracySourceView.cpp b/server/TracySourceView.cpp
index abe1fb99..c7ae6538 100644
--- a/server/TracySourceView.cpp
+++ b/server/TracySourceView.cpp
@@ -4882,11 +4882,11 @@ void SourceView::GatherIpHwStats( AddrStatData& as, Worker& worker, const View&
const auto end = m_propagateInlines ? frame->size : 1;
for( uint8_t i=0; i<end; i++ )
{
- auto ffn = worker.GetString( frame->data[i].file );
- if( strcmp( ffn, filename ) == 0 )
+ const auto line = frame->data[i].line;
+ if( line != 0 )
{
- const auto line = frame->data[i].line;
- if( line != 0 )
+ auto ffn = worker.GetString( frame->data[i].file );
+ if( strcmp( ffn, filename ) == 0 )
{
auto it = as.ipCountSrc.find( line );
if( it == as.ipCountSrc.end() )
@@ -4957,11 +4957,11 @@ void SourceView::CountHwStats( AddrStatData& as, Worker& worker, const View& vie
const auto end = m_propagateInlines ? frame->size : 1;
for( uint8_t i=0; i<end; i++ )
{
- auto ffn = worker.GetString( frame->data[i].file );
- if( strcmp( ffn, filename ) == 0 )
+ const auto line = frame->data[i].line;
+ if( line != 0 )
{
- const auto line = frame->data[i].line;
- if( line != 0 )
+ auto ffn = worker.GetString( frame->data[i].file );
+ if( strcmp( ffn, filename ) == 0 )
{
auto it = as.hwCountSrc.find( line );
if( it == as.hwCountSrc.end() )
@@ -5008,11 +5008,11 @@ void SourceView::GatherIpStats( uint64_t baseAddr, AddrStatData& as, const Worke
const auto end = m_propagateInlines ? frame->size : 1;
for( uint8_t i=0; i<end; i++ )
{
- auto ffn = worker.GetString( frame->data[i].file );
- if( strcmp( ffn, filename ) == 0 )
+ const auto line = frame->data[i].line;
+ if( line != 0 )
{
- const auto line = frame->data[i].line;
- if( line != 0 )
+ auto ffn = worker.GetString( frame->data[i].file );
+ if( strcmp( ffn, filename ) == 0 )
{
auto sit = as.ipCountSrc.find( line );
if( sit == as.ipCountSrc.end() )
@@ -5070,11 +5070,11 @@ void SourceView::GatherIpStats( uint64_t baseAddr, AddrStatData& as, const Worke
const auto end = m_propagateInlines ? frame->size : 1;
for( uint8_t i=0; i<end; i++ )
{
- auto ffn = worker.GetString( frame->data[i].file );
- if( strcmp( ffn, filename ) == 0 )
+ const auto line = frame->data[i].line;
+ if( line != 0 )
{
- const auto line = frame->data[i].line;
- if( line != 0 )
+ auto ffn = worker.GetString( frame->data[i].file );
+ if( strcmp( ffn, filename ) == 0 )
{
auto it = as.ipCountSrc.find( line );
if( it == as.ipCountSrc.end() )
@@ -5135,11 +5135,11 @@ void SourceView::GatherAdditionalIpStats( uint64_t baseAddr, AddrStatData& as, c
const auto end = m_propagateInlines ? frame->size : 1;
for( uint8_t i=0; i<end; i++ )
{
- auto ffn = worker.GetString( frame->data[i].file );
- if( strcmp( ffn, filename ) == 0 )
+ const auto line = frame->data[i].line;
+ if( line != 0 )
{
- const auto line = frame->data[i].line;
- if( line != 0 )
+ auto ffn = worker.GetString( frame->data[i].file );
+ if( strcmp( ffn, filename ) == 0 )
{
auto sit = as.ipCountSrc.find( line );
if( sit == as.ipCountSrc.end() )
@@ -5188,11 +5188,11 @@ void SourceView::GatherAdditionalIpStats( uint64_t baseAddr, AddrStatData& as, c
const auto end = m_propagateInlines ? frame->size : 1;
for( uint8_t i=0; i<end; i++ )
{
- auto ffn = worker.GetString( frame->data[i].file );
- if( strcmp( ffn, filename ) == 0 )
+ const auto line = frame->data[i].line;
+ if( line != 0 )
{
- const auto line = frame->data[i].line;
- if( line != 0 )
+ auto ffn = worker.GetString( frame->data[i].file );
+ if( strcmp( ffn, filename ) == 0 )
{
auto sit = as.ipCountSrc.find( line );
if( sit == as.ipCountSrc.end() )