Remove 'always true' if statements (PVS 547)
Change-Id: I8d50e0ca48b48e4ce5091efee65949c6d65099a3 Reviewed-on: https://review.haiku-os.org/c/haiku/+/2057 Reviewed-by: Axel Dörfler <[email protected]>
This commit is contained in:
committed by
Axel Dörfler
parent
d9e196c7f5
commit
a9e97bc01f
@@ -955,8 +955,7 @@ ClientConnection::VisitCloseRequest(CloseRequest* request)
|
||||
// no volume ID given, so this is a query handle
|
||||
// lock the handle
|
||||
QueryHandle* handle = NULL;
|
||||
if (result == B_OK)
|
||||
SET_ERROR(result, _LockQueryHandle(request->cookie, &handle));
|
||||
SET_ERROR(result, _LockQueryHandle(request->cookie, &handle));
|
||||
QueryHandleUnlocker handleUnlocker(this, handle);
|
||||
|
||||
// close it
|
||||
@@ -2366,12 +2365,10 @@ ClientConnection::VisitOpenQueryRequest(OpenQueryRequest* request)
|
||||
VolumeManagerLocker managerLocker;
|
||||
|
||||
// open the query
|
||||
status_t result = B_OK;
|
||||
status_t result;
|
||||
QueryHandle* handle = NULL;
|
||||
if (result == B_OK) {
|
||||
result = _OpenQuery(request->queryString.GetString(),
|
||||
result = _OpenQuery(request->queryString.GetString(),
|
||||
request->flags, request->port, request->token, &handle);
|
||||
}
|
||||
QueryHandleUnlocker handleUnlocker(this, handle);
|
||||
|
||||
// prepare the reply
|
||||
@@ -2890,12 +2887,10 @@ ClientConnection::_NodeMonitoringProcessor()
|
||||
ObjectDeleter<NodeMonitoringRequest> requestDeleter(request);
|
||||
|
||||
// send the request
|
||||
if (error == B_OK) {
|
||||
error = fConnection->SendRequest(request);
|
||||
if (error != B_OK) {
|
||||
ERROR(("ClientConnection::_NodeMonitoringProcessor(): "
|
||||
"Failed to send request.\n"));
|
||||
}
|
||||
error = fConnection->SendRequest(request);
|
||||
if (error != B_OK) {
|
||||
ERROR(("ClientConnection::_NodeMonitoringProcessor(): "
|
||||
"Failed to send request.\n"));
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
|
||||
@@ -1468,7 +1468,7 @@ socket_send(net_socket* socket, msghdr* header, const void* data, size_t length,
|
||||
}
|
||||
|
||||
// attach ancillary data to the first buffer
|
||||
status_t status = B_OK;
|
||||
status_t status;
|
||||
if (ancillaryData != NULL) {
|
||||
gNetBufferModule.set_ancillary_data(buffer, ancillaryData);
|
||||
ancillaryDataDeleter.Detach();
|
||||
@@ -1481,10 +1481,7 @@ socket_send(net_socket* socket, msghdr* header, const void* data, size_t length,
|
||||
memcpy(buffer->destination, address, addressLength);
|
||||
buffer->destination->sa_len = addressLength;
|
||||
|
||||
if (status == B_OK) {
|
||||
status = socket->first_info->send_data(socket->first_protocol,
|
||||
buffer);
|
||||
}
|
||||
status = socket->first_info->send_data(socket->first_protocol, buffer);
|
||||
if (status != B_OK) {
|
||||
size_t sizeAfterSend = buffer->size;
|
||||
gNetBufferModule.free(buffer);
|
||||
@@ -1655,8 +1652,7 @@ socket_socketpair(int family, int type, int protocol, net_socket* sockets[2])
|
||||
if (error != B_OK)
|
||||
return error;
|
||||
|
||||
if (error == B_OK)
|
||||
error = socket_open(family, type, protocol, &sockets[1]);
|
||||
error = socket_open(family, type, protocol, &sockets[1]);
|
||||
|
||||
// bind one
|
||||
if (error == B_OK)
|
||||
|
||||
Reference in New Issue
Block a user