mirror of
https://github.com/wolfpld/tracy
synced 2025-04-30 04:43:53 +00:00
Build lists of unique source files in comparison menu.
This commit is contained in:
parent
886456ea44
commit
bd06d4e104
@ -741,6 +741,9 @@ private:
|
|||||||
int64_t total[2];
|
int64_t total[2];
|
||||||
int minBinVal = 1;
|
int minBinVal = 1;
|
||||||
int compareMode = 0;
|
int compareMode = 0;
|
||||||
|
bool diffDone = false;
|
||||||
|
std::vector<const char*> thisUnique;
|
||||||
|
std::vector<const char*> secondUnique;
|
||||||
|
|
||||||
void ResetSelection()
|
void ResetSelection()
|
||||||
{
|
{
|
||||||
@ -762,6 +765,9 @@ private:
|
|||||||
match[i].clear();
|
match[i].clear();
|
||||||
selMatch[i] = 0;
|
selMatch[i] = 0;
|
||||||
}
|
}
|
||||||
|
diffDone = false;
|
||||||
|
thisUnique.clear();
|
||||||
|
secondUnique.clear();
|
||||||
}
|
}
|
||||||
} m_compare;
|
} m_compare;
|
||||||
|
|
||||||
|
@ -254,6 +254,40 @@ void View::DrawCompare()
|
|||||||
{
|
{
|
||||||
ImGui::Separator();
|
ImGui::Separator();
|
||||||
ImGui::BeginChild( "##compare" );
|
ImGui::BeginChild( "##compare" );
|
||||||
|
|
||||||
|
if( !m_compare.diffDone )
|
||||||
|
{
|
||||||
|
m_compare.diffDone = true;
|
||||||
|
|
||||||
|
const auto& tfc = m_worker.GetSourceFileCache();
|
||||||
|
const auto& ofc = m_compare.second->GetSourceFileCache();
|
||||||
|
|
||||||
|
if( !tfc.empty() && !ofc.empty() )
|
||||||
|
{
|
||||||
|
for( auto& tv : tfc )
|
||||||
|
{
|
||||||
|
auto it = ofc.find( tv.first );
|
||||||
|
if( it == ofc.end() )
|
||||||
|
{
|
||||||
|
m_compare.thisUnique.emplace_back( tv.first );
|
||||||
|
}
|
||||||
|
else if( tv.second.len != it->second.len || memcmp( tv.second.data, it->second.data, tv.second.len ) != 0 )
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for( auto& ov : ofc )
|
||||||
|
{
|
||||||
|
auto it = tfc.find( ov.first );
|
||||||
|
if( it == tfc.end() )
|
||||||
|
{
|
||||||
|
m_compare.secondUnique.emplace_back( ov.first );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
std::sort( m_compare.thisUnique.begin(), m_compare.thisUnique.end(), []( const auto& lhs, const auto& rhs ) { return strcmp( lhs, rhs ) < 0; } );
|
||||||
|
std::sort( m_compare.secondUnique.begin(), m_compare.secondUnique.end(), []( const auto& lhs, const auto& rhs ) { return strcmp( lhs, rhs ) < 0; } );
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user