More optimization in project rescue.
This commit is contained in:
parent
c523ba45e1
commit
0be56451b1
|
@ -276,7 +276,10 @@ public:
|
|||
LIB_ID id( wxEmptyString, part_name );
|
||||
|
||||
case_sensitive_match = aRescuer.GetLibs()->FindLibraryAlias( id );
|
||||
aRescuer.GetLibs()->FindLibraryNearEntries( case_insensitive_matches, part_name );
|
||||
|
||||
if( !case_sensitive_match )
|
||||
// the case sensitive match failed. Try a case insensitive match
|
||||
aRescuer.GetLibs()->FindLibraryNearEntries( case_insensitive_matches, part_name );
|
||||
}
|
||||
|
||||
if( case_sensitive_match || !( case_insensitive_matches.size() ) )
|
||||
|
@ -285,6 +288,7 @@ public:
|
|||
RESCUE_CASE_CANDIDATE candidate(
|
||||
part_name, case_insensitive_matches[0]->GetName(),
|
||||
case_insensitive_matches[0]->GetPart() );
|
||||
|
||||
candidate_map[part_name] = candidate;
|
||||
}
|
||||
|
||||
|
@ -379,20 +383,22 @@ public:
|
|||
cache_match = find_component( part_name, aRescuer.GetLibs(), /* aCached */ true );
|
||||
LIB_ID id( wxEmptyString, part_name );
|
||||
lib_match = aRescuer.GetLibs()->FindLibPart( id );
|
||||
|
||||
// Test whether there is a conflict
|
||||
if( !cache_match || !lib_match )
|
||||
continue;
|
||||
|
||||
if( !cache_match->PinsConflictWith( *lib_match, /* aTestNums */ true,
|
||||
/* aTestNames */ true, /* aTestType */ true, /* aTestOrientation */ true,
|
||||
/* aTestLength */ false ))
|
||||
continue;
|
||||
|
||||
RESCUE_CACHE_CANDIDATE candidate(
|
||||
part_name, part_name + part_name_suffix,
|
||||
cache_match, lib_match );
|
||||
|
||||
candidate_map[part_name] = candidate;
|
||||
}
|
||||
|
||||
// Test whether there is a conflict
|
||||
if( !cache_match || !lib_match )
|
||||
continue;
|
||||
if( !cache_match->PinsConflictWith( *lib_match, /* aTestNums */ true,
|
||||
/* aTestNames */ true, /* aTestType */ true, /* aTestOrientation */ true,
|
||||
/* aTestLength */ false ))
|
||||
continue;
|
||||
|
||||
RESCUE_CACHE_CANDIDATE candidate(
|
||||
part_name, part_name + part_name_suffix,
|
||||
cache_match, lib_match );
|
||||
candidate_map[part_name] = candidate;
|
||||
}
|
||||
|
||||
// Now, dump the map into aCandidates
|
||||
|
|
|
@ -35,6 +35,7 @@
|
|||
#include <string>
|
||||
#include <iostream>
|
||||
#include <iomanip>
|
||||
#include <wx/log.h>
|
||||
|
||||
/**
|
||||
* The class PROF_COUNTER is a small class to help profiling.
|
||||
|
@ -99,6 +100,21 @@ public:
|
|||
std::cerr << m_name << " took " << elapsed.count() << " milliseconds." << std::endl;
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the elapsed time (in ms) in a wxLogMessage window.
|
||||
*/
|
||||
void ShowDlg()
|
||||
{
|
||||
TIME_POINT display_stoptime = m_running ?
|
||||
std::chrono::high_resolution_clock::now() :
|
||||
m_stoptime;
|
||||
|
||||
std::chrono::duration<double, std::milli> elapsed = display_stoptime - m_starttime;
|
||||
wxString msg;
|
||||
msg << m_name << " took " << elapsed.count() << " ms.";
|
||||
wxLogMessage( msg );
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the elapsed time in ms
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue