-
Notifications
You must be signed in to change notification settings - Fork 42
Use std::vector<char> instead of std::unique_ptr<char[]>
#828
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use std::vector<char> instead of std::unique_ptr<char[]>
#828
Conversation
0aaee44 to
3db24c4
Compare
|
Rebased |
test/provider_coarse.cpp
Outdated
| void *buf = buffer.get(); | ||
| // preallocate some memory and initialize the vector with zeros | ||
| std::vector<char> buffer(init_buffer_size, 0); | ||
| void *buf = buffer.data(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume implicit cast by Coverity due to type conversion:
data() returns value_type*, in this case char*
https://cplusplus.com/reference/vector/vector/data/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@KFilipek Done
Use std::vector<char> instead of std::unique_ptr<char[]> because we do not need to use memset(0) in this case. Signed-off-by: Lukasz Dorau <[email protected]>
3db24c4 to
a4080b4
Compare
KFilipek
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Description
Use
std::vector<char>instead ofstd::unique_ptr<char[]>because we do not need to use memset(0) in this case.
Checklist