@@ -2064,7 +2064,6 @@ mongoc_collection_find_and_modify_with_opts (mongoc_collection_t
20642064 const char * name ;
20652065 bool ret ;
20662066 bson_t command = BSON_INITIALIZER ;
2067- mongoc_write_concern_t * wc ;
20682067
20692068 ENTRY ;
20702069
@@ -2112,10 +2111,8 @@ mongoc_collection_find_and_modify_with_opts (mongoc_collection_t
21122111 !!opts -> bypass_document_validation );
21132112 }
21142113
2115- wc = opts -> write_concern ? opts -> write_concern : collection -> write_concern ;
2116-
21172114 if (server_stream -> sd -> max_wire_version >= WIRE_VERSION_FAM_WRITE_CONCERN ) {
2118- if (!_mongoc_write_concern_is_valid (wc )) {
2115+ if (!_mongoc_write_concern_is_valid (collection -> write_concern )) {
21192116 bson_set_error (error ,
21202117 MONGOC_ERROR_COMMAND ,
21212118 MONGOC_ERROR_COMMAND_INVALID_ARG ,
@@ -2125,8 +2122,8 @@ mongoc_collection_find_and_modify_with_opts (mongoc_collection_t
21252122 RETURN (false);
21262123 }
21272124
2128- if (_mongoc_write_concern_needs_gle (wc )) {
2129- _BSON_APPEND_WRITE_CONCERN (& command , wc );
2125+ if (_mongoc_write_concern_needs_gle (collection -> write_concern )) {
2126+ _BSON_APPEND_WRITE_CONCERN (& command , collection -> write_concern );
21302127 }
21312128 }
21322129
@@ -2211,7 +2208,6 @@ mongoc_collection_find_and_modify (mongoc_collection_t *collection,
22112208 mongoc_find_and_modify_opts_set_update (opts , update );
22122209 mongoc_find_and_modify_opts_set_fields (opts , fields );
22132210 mongoc_find_and_modify_opts_set_flags (opts , flags );
2214- mongoc_find_and_modify_opts_set_write_concern (opts , collection -> write_concern );
22152211
22162212 ret = mongoc_collection_find_and_modify_with_opts (collection , query , opts , reply , error );
22172213 mongoc_find_and_modify_opts_destroy (opts );
0 commit comments