Skip to content

Commit 7ab5fb6

Browse files
authored
Code cleanup (yhirose#1593)
1 parent 8df5fed commit 7ab5fb6

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

httplib.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2024,7 +2024,7 @@ inline bool from_hex_to_i(const std::string &s, size_t i, size_t cnt,
20242024
}
20252025

20262026
inline std::string from_i_to_hex(size_t n) {
2027-
const char *charset = "0123456789abcdef";
2027+
static const auto charset = "0123456789abcdef";
20282028
std::string ret;
20292029
do {
20302030
ret = charset[n & 15] + ret;
@@ -2364,7 +2364,7 @@ inline int close_socket(socket_t sock) {
23642364
}
23652365

23662366
template <typename T> inline ssize_t handle_EINTR(T fn) {
2367-
ssize_t res = false;
2367+
ssize_t res = 0;
23682368
while (true) {
23692369
res = fn();
23702370
if (res < 0 && errno == EINTR) { continue; }
@@ -3389,7 +3389,7 @@ inline bool brotli_decompressor::decompress(const char *data,
33893389
return 0;
33903390
}
33913391

3392-
const uint8_t *next_in = reinterpret_cast<const uint8_t *>(data);
3392+
auto next_in = reinterpret_cast<const uint8_t *>(data);
33933393
size_t avail_in = data_length;
33943394
size_t total_out;
33953395

0 commit comments

Comments
 (0)