From 87ffb27492e24fa7caa62d9e48b4cf10e0cb9fb2 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: Sat, 26 Feb 2022 11:10:20 +0100 Subject: [PATCH] tidy: preallocate vector size --- alib2abstraction/src/core/type_details.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/alib2abstraction/src/core/type_details.cpp b/alib2abstraction/src/core/type_details.cpp index 8d6bd65dca..97a2cecc51 100644 --- a/alib2abstraction/src/core/type_details.cpp +++ b/alib2abstraction/src/core/type_details.cpp @@ -22,7 +22,7 @@ type_details type_details::as_type ( const std::string & string ) { } type_details type_details::as_type ( const std::string & string, const std::vector < std::string > & templateParams ) { - std::vector < std::unique_ptr < type_details_base > > templates; + std::vector < std::unique_ptr < type_details_base > > templates ( templateParams.size ( ) ); for ( const std::string & templateParam : templateParams ) { templates.push_back ( std::make_unique < type_details_type > ( templateParam ) ); } -- GitLab