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 committed Oct 10, 2024
1 parent 2f90c7b commit 7ce2d74
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 @@ -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;
}

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

Expand Down

0 comments on commit 7ce2d74

Please sign in to comment.