1
0
mirror of synced 2025-12-17 04:02:14 +03:00

Change single char string literals to chars (#2304)

This commit is contained in:
Aaron Gokaslan
2025-12-13 22:52:12 -05:00
committed by GitHub
parent bce08e62f9
commit 3401877d3d

View File

@@ -5398,7 +5398,7 @@ bool read_content(Stream &strm, T &x, size_t payload_max_length, int &status,
inline ssize_t write_request_line(Stream &strm, const std::string &method,
const std::string &path) {
std::string s = method;
s += " ";
s += ' ';
s += path;
s += " HTTP/1.1\r\n";
return strm.write(s.data(), s.size());
@@ -5407,7 +5407,7 @@ inline ssize_t write_request_line(Stream &strm, const std::string &method,
inline ssize_t write_response_line(Stream &strm, int status) {
std::string s = "HTTP/1.1 ";
s += std::to_string(status);
s += " ";
s += ' ';
s += httplib::status_message(status);
s += "\r\n";
return strm.write(s.data(), s.size());
@@ -5682,9 +5682,9 @@ inline std::string params_to_query_str(const Params &params) {
std::string query;
for (auto it = params.begin(); it != params.end(); ++it) {
if (it != params.begin()) { query += "&"; }
if (it != params.begin()) { query += '&'; }
query += encode_query_component(it->first);
query += "=";
query += '=';
query += encode_query_component(it->second);
}
return query;
@@ -6443,9 +6443,9 @@ inline std::string make_content_range_header_field(
std::string field = "bytes ";
field += std::to_string(st);
field += "-";
field += '-';
field += std::to_string(ed);
field += "/";
field += '/';
field += std::to_string(content_length);
return field;
}