mirror of
https://github.com/nasa/trick.git
synced 2024-12-18 20:57:55 +00:00
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:
parent
35b4cf7880
commit
bdc40e3709
@ -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 ;
|
||||
|
Loading…
Reference in New Issue
Block a user