From 2a2e65abad168d1c220827ac2dcb38a8414a9981 Mon Sep 17 00:00:00 2001 From: Jared Boone Date: Thu, 3 Dec 2015 20:34:30 -0800 Subject: [PATCH] Reserve length of AIS packet text std::string. --- firmware/application/app_ais.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/firmware/application/app_ais.cpp b/firmware/application/app_ais.cpp index cf624e3c..fa96ed18 100644 --- a/firmware/application/app_ais.cpp +++ b/firmware/application/app_ais.cpp @@ -247,6 +247,8 @@ std::string Packet::text( const size_t character_count ) const { std::string result; + result.reserve(character_count); + const size_t character_length = 6; const size_t end_bit = start_bit + character_count * character_length; for(size_t i=start_bit; i