Skip to content

Commit 5b8025b

Browse files
Use assign for deserialize instead of temporary std::string (#241)
Signed-off-by: Samuel Hyyppä <[email protected]> Co-authored-by: Samuel Hyyppä <[email protected]>
1 parent abf6c9a commit 5b8025b

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

include/fastcdr/Cdr.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1793,7 +1793,7 @@ class Cdr
17931793
{
17941794
uint32_t length = 0;
17951795
const char* str = read_string(length);
1796-
value = std::string(str, length);
1796+
value.assign(str, length);
17971797
return *this;
17981798
}
17991799

include/fastcdr/FastCdr.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1552,7 +1552,7 @@ class Cdr_DllAPI FastCdr
15521552
{
15531553
uint32_t length = 0;
15541554
const char* str = read_string(length);
1555-
string_t = std::string(str, length);
1555+
string_t.assign(str, length);
15561556
return *this;
15571557
}
15581558

0 commit comments

Comments
 (0)