Skip to content

Commit

Permalink
Code review part 2
Browse files Browse the repository at this point in the history
  • Loading branch information
chusitoo committed Dec 11, 2024
1 parent 5b610f7 commit f9acefe
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ext/src/http/client/curl/http_client_curl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ int deflateInPlace(z_stream *strm, unsigned char *buf, uint32_t len, uint32_t *m
*max = len;
}
strm->next_out = temp.data();
strm->avail_out = std::min(static_cast<decltype(z_stream::avail_out)>(temp.size()), *max);
strm->avail_out = (std::min)(static_cast<decltype(z_stream::avail_out)>(temp.size()), *max);
auto ret = deflate(strm, Z_FINISH);
if (ret == Z_STREAM_ERROR)
{
Expand All @@ -90,7 +90,7 @@ int deflateInPlace(z_stream *strm, unsigned char *buf, uint32_t len, uint32_t *m
// if we can, copy the temporary output data to the consumed portion of the input buffer, and then
// continue to write up to the start of the consumed input for as long as possible
auto have = strm->next_out - temp.data(); // number of bytes in temp[]
if (have <= (strm->avail_in ? len - strm->avail_in : *max))
if (have <= static_cast<decltype(have)>(strm->avail_in ? len - strm->avail_in : *max))
{
std::memcpy(buf, temp.data(), have);
strm->next_out = buf + have;
Expand Down

0 comments on commit f9acefe

Please sign in to comment.