From 7ce2d74420d23bf8fc8038dc6c8398f966ff8f0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20Hyypp=C3=A4?= Date: Thu, 10 Oct 2024 15:19:18 +0300 Subject: [PATCH] Use assign for deserialize instead of temporary std::string MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Samuel Hyyppä --- include/fastcdr/Cdr.h | 2 +- include/fastcdr/FastCdr.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/fastcdr/Cdr.h b/include/fastcdr/Cdr.h index 983c886b..439b1dde 100644 --- a/include/fastcdr/Cdr.h +++ b/include/fastcdr/Cdr.h @@ -1804,7 +1804,7 @@ class Cdr { uint32_t length = 0; const char* str = read_string(length); - value = std::string(str, length); + value.assign(str, length); return *this; } diff --git a/include/fastcdr/FastCdr.h b/include/fastcdr/FastCdr.h index d009e99c..373d1c73 100644 --- a/include/fastcdr/FastCdr.h +++ b/include/fastcdr/FastCdr.h @@ -1541,7 +1541,7 @@ class Cdr_DllAPI FastCdr { uint32_t length = 0; const char* str = read_string(length); - string_t = std::string(str, length); + string_t.assign(str, length); return *this; }