forked from rdkcentral/Thunder
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Messaging] Removing unnecessary string copying and casts (rdkcentral…
…#1601) * Removing unncessary const casts * Adding a new optional parameter to NullTerminatedText to avoid unnecessary string copies when cutting the string * Using the new parameter in NullTerminatedText instead of making a string copy and cutting the text manually * Optimizing the SetNullTerminatedText method * Simplifying the method further to avoid unnecessary std::min and code repetition * Removing unnecessary string copy in Output method from DirectOutput in messaging * Removing a string creation in Output methods from ConsolStreamRedirect, putting the buffer into TextMessage constructor instead * Adding a new constructor to TextMessage which takes buffer and length, use the new maxLength param of NullTerinatedText in Serialize * Changing the maxLength param to be default as ~0, passing length of the string straight in its constructor so that no excess memory is allocated
- Loading branch information
1 parent
e44638f
commit eff6ab5
Showing
6 changed files
with
20 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters