From 4c2150fb3d0e5e8cc73919f0806d56fcd58e282e Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Wed, 19 Jan 2022 03:50:39 +0200 Subject: [PATCH] Minor updates to benchmark/string.cpp --- benchmark/string.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/benchmark/string.cpp b/benchmark/string.cpp index 86784a08..3da8103e 100644 --- a/benchmark/string.cpp +++ b/benchmark/string.cpp @@ -38,13 +38,14 @@ static std::vector indices1, indices2, indices3; static std::string make_index( std::uint32_t x ) { char buffer[ 64 ]; - std::snprintf( buffer, sizeof(buffer), "pfx_%d_sfx", x ); + std::snprintf( buffer, sizeof(buffer), "pfx_%u_sfx", x ); return buffer; } static void init_indices() { + indices1.reserve( N*2+1 ); indices1.push_back( make_index( 0 ) ); for( unsigned i = 1; i <= N*2; ++i ) @@ -52,6 +53,7 @@ static void init_indices() indices1.push_back( make_index( i ) ); } + indices2.reserve( N*2+1 ); indices2.push_back( make_index( 0 ) ); { @@ -63,6 +65,7 @@ static void init_indices() } } + indices3.reserve( N*2+1 ); indices3.push_back( make_index( 0 ) ); for( unsigned i = 1; i <= N*2; ++i )