mirror of
https://github.com/nghttp2/nghttp2.git
synced 2025-12-07 02:28:53 +08:00
Fix scan-build error
This commit is contained in:
@@ -801,6 +801,7 @@ TimeStat<Duration> compute_time_stat(const std::vector<Duration> &samples) {
|
|||||||
a = na;
|
a = na;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
assert(n > 0);
|
||||||
res.mean = Duration(sum / n);
|
res.mean = Duration(sum / n);
|
||||||
res.sd = Duration(static_cast<typename Duration::rep>(sqrt(q / n)));
|
res.sd = Duration(static_cast<typename Duration::rep>(sqrt(q / n)));
|
||||||
res.within_sd = within_sd(samples, res.mean, res.sd);
|
res.within_sd = within_sd(samples, res.mean, res.sd);
|
||||||
|
|||||||
@@ -832,7 +832,7 @@ parse_next_link_header_once(const char *first, const char *last) {
|
|||||||
static constexpr size_t PLLEN = sizeof(PL) - 1;
|
static constexpr size_t PLLEN = sizeof(PL) - 1;
|
||||||
if (first + PLLEN == last) {
|
if (first + PLLEN == last) {
|
||||||
if (std::equal(PL, PL + PLLEN, first, util::CaseCmp())) {
|
if (std::equal(PL, PL + PLLEN, first, util::CaseCmp())) {
|
||||||
ok = true;
|
// ok = true;
|
||||||
// this is the end of sequence
|
// this is the end of sequence
|
||||||
return {{{url_first, url_last}}, last};
|
return {{{url_first, url_last}}, last};
|
||||||
}
|
}
|
||||||
@@ -842,7 +842,7 @@ parse_next_link_header_once(const char *first, const char *last) {
|
|||||||
if (!std::equal(PL, PL + PLLEN, first, util::CaseCmp())) {
|
if (!std::equal(PL, PL + PLLEN, first, util::CaseCmp())) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
ok = true;
|
// ok = true;
|
||||||
// skip including ','
|
// skip including ','
|
||||||
first += PLLEN + 1;
|
first += PLLEN + 1;
|
||||||
return {{{url_first, url_last}}, first};
|
return {{{url_first, url_last}}, first};
|
||||||
|
|||||||
@@ -167,6 +167,8 @@ void on_ctrl_recv_callback(spdylay_session *session, spdylay_frame_type type,
|
|||||||
size_t header_buffer = 0;
|
size_t header_buffer = 0;
|
||||||
for (size_t i = 0; nv[i]; i += 2) {
|
for (size_t i = 0; nv[i]; i += 2) {
|
||||||
++num_headers;
|
++num_headers;
|
||||||
|
// shut up scan-build
|
||||||
|
assert(nv[i + 1]);
|
||||||
header_buffer += strlen(nv[i]) + strlen(nv[i + 1]);
|
header_buffer += strlen(nv[i]) + strlen(nv[i + 1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user