Skip to content

Commit 07c17ce

Browse files
committed
CDRIVER-697 no bson_return_val_if_fail in RPC code
1 parent dbb5423 commit 07c17ce

File tree

1 file changed

+0
-18
lines changed

1 file changed

+0
-18
lines changed

src/mongoc/mongoc-rpc.c

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -440,9 +440,6 @@ void
440440
_mongoc_rpc_gather (mongoc_rpc_t *rpc,
441441
mongoc_array_t *array)
442442
{
443-
bson_return_if_fail(rpc);
444-
bson_return_if_fail(array);
445-
446443
switch ((mongoc_opcode_t)rpc->header.opcode) {
447444
case MONGOC_OPCODE_REPLY:
448445
_mongoc_rpc_gather_reply(&rpc->reply, array);
@@ -481,8 +478,6 @@ _mongoc_rpc_swab_to_le (mongoc_rpc_t *rpc)
481478
#if BSON_BYTE_ORDER != BSON_LITTLE_ENDIAN
482479
mongoc_opcode_t opcode;
483480

484-
bson_return_if_fail(rpc);
485-
486481
opcode = rpc->header.opcode;
487482

488483
switch (opcode) {
@@ -524,8 +519,6 @@ _mongoc_rpc_swab_from_le (mongoc_rpc_t *rpc)
524519
#if BSON_BYTE_ORDER != BSON_LITTLE_ENDIAN
525520
mongoc_opcode_t opcode;
526521

527-
bson_return_if_fail(rpc);
528-
529522
opcode = BSON_UINT32_FROM_LE(rpc->header.opcode);
530523

531524
switch (opcode) {
@@ -564,8 +557,6 @@ _mongoc_rpc_swab_from_le (mongoc_rpc_t *rpc)
564557
void
565558
_mongoc_rpc_printf (mongoc_rpc_t *rpc)
566559
{
567-
bson_return_if_fail(rpc);
568-
569560
switch ((mongoc_opcode_t)rpc->header.opcode) {
570561
case MONGOC_OPCODE_REPLY:
571562
_mongoc_rpc_printf_reply(&rpc->reply);
@@ -605,10 +596,6 @@ _mongoc_rpc_scatter (mongoc_rpc_t *rpc,
605596
{
606597
mongoc_opcode_t opcode;
607598

608-
bson_return_val_if_fail(rpc, false);
609-
bson_return_val_if_fail(buf, false);
610-
bson_return_val_if_fail(buflen, false);
611-
612599
memset (rpc, 0, sizeof *rpc);
613600

614601
if (BSON_UNLIKELY(buflen < 16)) {
@@ -651,9 +638,6 @@ _mongoc_rpc_reply_get_first (mongoc_rpc_reply_t *reply,
651638
{
652639
int32_t len;
653640

654-
bson_return_val_if_fail(reply, false);
655-
bson_return_val_if_fail(bson, false);
656-
657641
if (!reply->documents || reply->documents_len < 4) {
658642
return false;
659643
}
@@ -692,8 +676,6 @@ bool
692676
_mongoc_rpc_needs_gle (mongoc_rpc_t *rpc,
693677
const mongoc_write_concern_t *write_concern)
694678
{
695-
bson_return_val_if_fail(rpc, false);
696-
697679
switch (rpc->header.opcode) {
698680
case MONGOC_OPCODE_REPLY:
699681
case MONGOC_OPCODE_QUERY:

0 commit comments

Comments
 (0)