From 81c91a87fcc88e74787a8409c558b84bdb10bbbb Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Tue, 26 Jan 2021 01:47:00 +0100 Subject: [PATCH] Search in cache before issuing syscall. --- server/TracyWorker.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/server/TracyWorker.cpp b/server/TracyWorker.cpp index fde2f4d7..4a3a0243 100644 --- a/server/TracyWorker.cpp +++ b/server/TracyWorker.cpp @@ -7388,10 +7388,10 @@ void Worker::CacheSource( const StringRef& str ) assert( m_checkedFileStrings.find( str ) == m_checkedFileStrings.end() ); m_checkedFileStrings.emplace( str ); auto file = GetString( str ); - if( SourceFileValid( file, GetCaptureTime() ) ) + // Possible duplication of pointer and index strings + if( m_data.sourceFileCache.find( file ) == m_data.sourceFileCache.end() ) { - // Possible duplication of pointer and index strings - if( m_data.sourceFileCache.find( file ) == m_data.sourceFileCache.end() ) + if( SourceFileValid( file, GetCaptureTime() ) ) { FILE* f = fopen( file, "rb" ); fseek( f, 0, SEEK_END );