std::string::data() and std::string::c_str() are equivalent.
Enhance the readability-redundant-string-cstr check to also handle
calls to data().
Details
Details
Diff Detail
Diff Detail
- Build Status
Buildable 1003 Build 1003: arc lint + arc unit
Event Timeline
Comment Actions
LGTM!
I like the idea, but would point out that data() and c_str() had different semantics once upon a time. In c++03 and earlier, data() was not guaranteed to be null terminated, but`c_str()` was. However, I'm not certain that's worth altering the behavior of this check for; I don't think any implementation actually made that distinction in practice.