Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobias Nießen <tniessen@tnie.de>2020-07-20 00:14:56 +0300
committerJames M Snell <jasnell@gmail.com>2020-08-11 23:22:04 +0300
commit1be7bbdc3b533759072cfc3d13766511197e3d01 (patch)
tree1428a01ca9e82cc939fc64e687ce51c4751aa044 /src/node_http2.cc
parentf280d2c85cf5bcf2cbe277de5a1f410a68c7a562 (diff)
src: prefer C++ empty() in boolean expressions
PR-URL: https://github.com/nodejs/node/pull/34432 Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Jiawen Geng <technicalcute@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
Diffstat (limited to 'src/node_http2.cc')
-rw-r--r--src/node_http2.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/node_http2.cc b/src/node_http2.cc
index 670fa4802a4..7b0e4e8af20 100644
--- a/src/node_http2.cc
+++ b/src/node_http2.cc
@@ -1517,7 +1517,7 @@ void Http2Session::ClearOutgoing(int status) {
set_sending(false);
- if (outgoing_buffers_.size() > 0) {
+ if (!outgoing_buffers_.empty()) {
outgoing_storage_.clear();
outgoing_length_ = 0;
@@ -1536,7 +1536,7 @@ void Http2Session::ClearOutgoing(int status) {
// Now that we've finished sending queued data, if there are any pending
// RstStreams we should try sending again and then flush them one by one.
- if (pending_rst_streams_.size() > 0) {
+ if (!pending_rst_streams_.empty()) {
std::vector<int32_t> current_pending_rst_streams;
pending_rst_streams_.swap(current_pending_rst_streams);
@@ -1595,8 +1595,8 @@ uint8_t Http2Session::SendPendingData() {
ssize_t src_length;
const uint8_t* src;
- CHECK_EQ(outgoing_buffers_.size(), 0);
- CHECK_EQ(outgoing_storage_.size(), 0);
+ CHECK(outgoing_buffers_.empty());
+ CHECK(outgoing_storage_.empty());
// Part One: Gather data from nghttp2