Vector Optimize to Save on Re-Allocation costs.

We know how many more elements we are going to push into ```listLogGroupIterators_``` so use that to our advantange and reserve inadvance to save on re-allocation costs.
This commit is contained in:
Shahzad Lone 2019-01-25 01:24:12 +00:00
parent 35b4cf7880
commit bdc40e3709

View File

@ -124,6 +124,8 @@ IterOverLogGroups::IterOverLogGroups( LogMultiGroup* lmg,
LogGroup* key ;
vector < int > val ;
map < LogGroup*, set< int > >::const_iterator ll;
listLogGroupIterators_.reserve(listLogGroupIterators_.size()
+ lg2log.size());
for (ll = lg2log.begin(); ll != lg2log.end(); ll++) {
key = (*ll).first ;