Skip to content

Commit aeb43ee

Browse files
committed
client: do not cast nullptr
Somewhy we cast `nullptr` to the needed class sometimes and it looks ugly. Anyway, `nullptr` is designed to be casted to any pointer automatically, so let's just stop doing it.
1 parent 2dbe527 commit aeb43ee

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Client/Connector.hpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ Connector<BUFFER, NetProvider>::waitAll(Connection<BUFFER, NetProvider> &conn,
266266
strerror(errno), errno);
267267
return -1;
268268
}
269-
if (connectionDecodeResponses(conn, static_cast<Response<BUFFER>*>(nullptr)) != 0)
269+
if (connectionDecodeResponses(conn, nullptr) != 0)
270270
return -1;
271271
bool finish = true;
272272
for (size_t i = last_not_ready; i < futures.size(); ++i) {
@@ -306,7 +306,7 @@ Connector<BUFFER, NetProvider>::waitAny(int timeout)
306306
}
307307
Connection<BUFFER, NetProvider> conn = *m_ReadyToDecode.begin();
308308
assert(hasDataToDecode(conn));
309-
if (connectionDecodeResponses(conn, static_cast<Response<BUFFER>*>(nullptr)) != 0)
309+
if (connectionDecodeResponses(conn, nullptr) != 0)
310310
return std::nullopt;
311311
return conn;
312312
}
@@ -325,7 +325,7 @@ Connector<BUFFER, NetProvider>::waitCount(Connection<BUFFER, NetProvider> &conn,
325325
strerror(errno), errno);
326326
return -1;
327327
}
328-
if (connectionDecodeResponses(conn, static_cast<Response<BUFFER>*>(nullptr)) != 0)
328+
if (connectionDecodeResponses(conn, nullptr) != 0)
329329
return -1;
330330
if ((conn.getFutureCount() - ready_futures) >= future_count)
331331
return 0;

0 commit comments

Comments
 (0)