mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-10 02:31:48 +00:00
Cosmetics.
This commit is contained in:
parent
03e849a9ff
commit
6c728f6d23
@ -7389,19 +7389,17 @@ void Worker::CacheSource( const StringRef& str )
|
||||
m_checkedFileStrings.emplace( str );
|
||||
auto file = GetString( str );
|
||||
// Possible duplication of pointer and index strings
|
||||
if( m_data.sourceFileCache.find( file ) == m_data.sourceFileCache.end() )
|
||||
if( m_data.sourceFileCache.find( file ) != m_data.sourceFileCache.end() ) return;
|
||||
if( SourceFileValid( file, GetCaptureTime() ) )
|
||||
{
|
||||
if( SourceFileValid( file, GetCaptureTime() ) )
|
||||
{
|
||||
FILE* f = fopen( file, "rb" );
|
||||
fseek( f, 0, SEEK_END );
|
||||
const auto sz = ftell( f );
|
||||
fseek( f, 0, SEEK_SET );
|
||||
auto src = (char*)m_slab.AllocBig( sz );
|
||||
fread( src, 1, sz, f );
|
||||
fclose( f );
|
||||
m_data.sourceFileCache.emplace( file, MemoryBlock{ src, uint32_t( sz ) } );
|
||||
}
|
||||
FILE* f = fopen( file, "rb" );
|
||||
fseek( f, 0, SEEK_END );
|
||||
const auto sz = ftell( f );
|
||||
fseek( f, 0, SEEK_SET );
|
||||
auto src = (char*)m_slab.AllocBig( sz );
|
||||
fread( src, 1, sz, f );
|
||||
fclose( f );
|
||||
m_data.sourceFileCache.emplace( file, MemoryBlock{ src, uint32_t( sz ) } );
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user