Merge pull request #727 from shahzadlone/master

Vector Optimize to Save on Re-Allocation costs.
This commit is contained in:
Alex Lin 2019-01-31 07:42:23 -06:00 committed by GitHub
commit 0ce0398823
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 3 deletions

View File

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