Skip to content

[lldb] Remove redundant c_str() calls in stream output (NFC) #94839

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

Merged
merged 1 commit into from
Jun 8, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions lldb/tools/debugserver/source/JSON.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ JSONString::JSONString(const std::string &s)
: JSONValue(JSONValue::Kind::String), m_data(s) {}

void JSONString::Write(std::ostream &s) {
s << "\"" << json_string_quote_metachars(m_data).c_str() << "\"";
s << "\"" << json_string_quote_metachars(m_data) << "\"";
}

uint64_t JSONNumber::GetAsUnsigned() const {
Expand Down Expand Up @@ -395,7 +395,7 @@ JSONParser::Token JSONParser::GetToken(std::string &value) {
} else {
error << "error: got exponent character but no exponent digits at "
"offset in float value \""
<< value.c_str() << "\"";
<< value << "\"";
value = error.str();
return Token::Status;
}
Expand All @@ -405,8 +405,7 @@ JSONParser::Token JSONParser::GetToken(std::string &value) {
if (got_frac_digits) {
return Token::Float;
} else {
error << "error: no digits after decimal point \"" << value.c_str()
<< "\"";
error << "error: no digits after decimal point \"" << value << "\"";
value = error.str();
return Token::Status;
}
Expand All @@ -417,7 +416,7 @@ JSONParser::Token JSONParser::GetToken(std::string &value) {
// We need at least some integer digits to make an integer
return Token::Integer;
} else {
error << "error: no digits negate sign \"" << value.c_str() << "\"";
error << "error: no digits negate sign \"" << value << "\"";
value = error.str();
return Token::Status;
}
Expand Down
Loading