From b35d0be1d0db8561787c9be573a2b9eb4dab8844 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Tr=C3=A1vn=C3=AD=C4=8Dek?= <jan.travnicek@fit.cvut.cz> Date: Thu, 25 Nov 2021 16:02:06 +0100 Subject: [PATCH] tests: preallocate vector size --- tests/cppaql/arbologyTest.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/cppaql/arbologyTest.cpp b/tests/cppaql/arbologyTest.cpp index bc08362199..d84943853d 100644 --- a/tests/cppaql/arbologyTest.cpp +++ b/tests/cppaql/arbologyTest.cpp @@ -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 ) { std::vector < std::pair < std::string, std::string > > res; + res.reserve ( files.size ( ) ); for ( const auto & file : files ) res.emplace_back ( file, search_replace ( file, pattern, subj ) ); -- GitLab