mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-06 17:27:52 +00:00
Round one of fixes to avoid ridiculous numbers of spurious copy constructor and destructor calls.
Most of these fixes involve calls to BOOST_FOREACH to iterate over a map or unordered_map where the iterator type didn't perfectly match the internal type, so a reference into the map couldn't be created and a new value/content pair had to be created for each iteration.
This commit is contained in:
@@ -111,7 +111,7 @@ int JobQueue::getJobCountGE(JobType t)
|
||||
|
||||
boost::mutex::scoped_lock sl(mJobLock);
|
||||
|
||||
typedef std::pair<JobType, int> jt_int_pair;
|
||||
typedef std::map<JobType, int>::value_type jt_int_pair;
|
||||
BOOST_FOREACH(const jt_int_pair& it, mJobCounts)
|
||||
if (it.first >= t)
|
||||
ret += it.second;
|
||||
@@ -125,7 +125,7 @@ std::vector< std::pair<JobType, int> > JobQueue::getJobCounts()
|
||||
boost::mutex::scoped_lock sl(mJobLock);
|
||||
ret.reserve(mJobCounts.size());
|
||||
|
||||
typedef std::pair<JobType, int> jt_int_pair;
|
||||
typedef std::map<JobType, int>::value_type jt_int_pair;
|
||||
BOOST_FOREACH(const jt_int_pair& it, mJobCounts)
|
||||
ret.push_back(it);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user