Skip to content

Commit 9c3b215

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 00f1a67 commit 9c3b215

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Client/Connector.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ Connector<BUFFER, NetProvider>::waitAll(Connection<BUFFER, NetProvider> &conn,
264264
strerror(errno), errno);
265265
return -1;
266266
}
267-
if (connectionDecodeResponses(conn, static_cast<Response<BUFFER>*>(nullptr)) != 0)
267+
if (connectionDecodeResponses(conn, nullptr) != 0)
268268
return -1;
269269
bool finish = true;
270270
for (size_t i = last_not_ready; i < futures.size(); ++i) {
@@ -304,7 +304,7 @@ Connector<BUFFER, NetProvider>::waitAny(int timeout)
304304
}
305305
Connection<BUFFER, NetProvider> conn = *m_ReadyToDecode.begin();
306306
assert(hasDataToDecode(conn));
307-
if (connectionDecodeResponses(conn, static_cast<Response<BUFFER>*>(nullptr)) != 0)
307+
if (connectionDecodeResponses(conn, nullptr) != 0)
308308
return std::nullopt;
309309
return conn;
310310
}
@@ -323,7 +323,7 @@ Connector<BUFFER, NetProvider>::waitCount(Connection<BUFFER, NetProvider> &conn,
323323
strerror(errno), errno);
324324
return -1;
325325
}
326-
if (connectionDecodeResponses(conn, static_cast<Response<BUFFER>*>(nullptr)) != 0)
326+
if (connectionDecodeResponses(conn, nullptr) != 0)
327327
return -1;
328328
if ((conn.getFutureCount() - ready_futures) >= future_count)
329329
return 0;

0 commit comments

Comments
 (0)