Skip to content
Snippets Groups Projects
Commit b35d0be1 authored by Jan Trávníček's avatar Jan Trávníček
Browse files

tests: preallocate vector size

parent 4cb7adcc
No related branches found
No related tags found
1 merge request!200clang tidy fixes
...@@ -113,6 +113,7 @@ static std::string search_replace ( std::string text, const std::string & search ...@@ -113,6 +113,7 @@ static std::string search_replace ( std::string text, const std::string & search
   
static std::vector < std::pair < std::string, std::string > > pair_pattern_subject ( const std::vector < std::string > & files, const std::string & pattern, const std::string & subj ) { static std::vector < std::pair < std::string, std::string > > pair_pattern_subject ( const std::vector < std::string > & files, const std::string & pattern, const std::string & subj ) {
std::vector < std::pair < std::string, std::string > > res; std::vector < std::pair < std::string, std::string > > res;
res.reserve ( files.size ( ) );
for ( const auto & file : files ) for ( const auto & file : files )
res.emplace_back ( file, search_replace ( file, pattern, subj ) ); res.emplace_back ( file, search_replace ( file, pattern, subj ) );
   
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment