Skip to content

Commit 0649a8d

Browse files
committed
Eliminate forcing to bool in assertions.
1 parent 3c8d990 commit 0649a8d

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

src/worker.cpp

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ send_worker::send_worker(czmqpp::context& context)
5454
void send_worker::queue_send(const outgoing_message& message)
5555
{
5656
czmqpp::socket socket(context_, ZMQ_PUSH);
57-
BITCOIN_ASSERT(socket.self());
57+
BITCOIN_ASSERT(socket.self() != nullptr);
5858
DEBUG_ONLY(int rc =) socket.connect("inproc://trigger-send");
5959
BITCOIN_ASSERT(rc == zmq_success);
6060
message.send(socket);
@@ -68,9 +68,9 @@ request_worker::request_worker()
6868
heartbeat_socket_(context_, ZMQ_PUB),
6969
sender_(context_)
7070
{
71-
BITCOIN_ASSERT(socket_.self());
72-
BITCOIN_ASSERT(wakeup_socket_.self());
73-
BITCOIN_ASSERT(heartbeat_socket_.self());
71+
BITCOIN_ASSERT(socket_.self() != nullptr);
72+
BITCOIN_ASSERT(wakeup_socket_.self() != nullptr);
73+
BITCOIN_ASSERT(heartbeat_socket_.self() != nullptr);
7474
DEBUG_ONLY(int rc =) wakeup_socket_.bind("inproc://trigger-send");
7575
BITCOIN_ASSERT(rc != zmq_fail);
7676
}
@@ -141,10 +141,12 @@ void request_worker::poll()
141141
{
142142
// Poll for network updates.
143143
czmqpp::poller poller(socket_, wakeup_socket_);
144-
BITCOIN_ASSERT(poller.self());
144+
BITCOIN_ASSERT(poller.self() != nullptr);
145145
czmqpp::socket which = poller.wait(poll_sleep_interval);
146146

147-
BITCOIN_ASSERT(socket_.self() && wakeup_socket_.self());
147+
BITCOIN_ASSERT(socket_.self() != nullptr &&
148+
wakeup_socket_.self() != nullptr);
149+
148150
if (which == socket_)
149151
{
150152
// Get message

0 commit comments

Comments
 (0)