Skip to content
This repository has been archived by the owner on Mar 29, 2019. It is now read-only.

Don't create intermediate string in msg2str #11

Open
indygreg opened this issue Mar 1, 2012 · 0 comments
Open

Don't create intermediate string in msg2str #11

indygreg opened this issue Mar 1, 2012 · 0 comments
Labels

Comments

@indygreg
Copy link

indygreg commented Mar 1, 2012

msg2str is needlessly complicated. Use the std::string::assign has an overloaded instance that takes a char * and size_t. While you are there, consider changing the API to pass references instead of pointers. Or, at least check for NULL before doing anything.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant