Skip to content

Commit

Permalink
Use assign for deserialize instead of temporary std::string
Browse files Browse the repository at this point in the history
Signed-off-by: Samuel Hyyppä <[email protected]>
  • Loading branch information
SamuelSandvik authored and MiguelCompany committed Dec 17, 2024
1 parent 53d8c5e commit 5dd3c1c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion include/fastcdr/Cdr.h
Original file line number Diff line number Diff line change
Expand Up @@ -1793,7 +1793,7 @@ class Cdr
{
uint32_t length = 0;
const char* str = read_string(length);
value = std::string(str, length);
value.assign(str, length);
return *this;
}

Expand Down
2 changes: 1 addition & 1 deletion include/fastcdr/FastCdr.h
Original file line number Diff line number Diff line change
Expand Up @@ -1552,7 +1552,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;
}

Expand Down

0 comments on commit 5dd3c1c

Please sign in to comment.