@@ -2064,7 +2064,6 @@ mongoc_collection_find_and_modify_with_opts (mongoc_collection_t
2064
2064
const char * name ;
2065
2065
bool ret ;
2066
2066
bson_t command = BSON_INITIALIZER ;
2067
- mongoc_write_concern_t * wc ;
2068
2067
2069
2068
ENTRY ;
2070
2069
@@ -2112,10 +2111,8 @@ mongoc_collection_find_and_modify_with_opts (mongoc_collection_t
2112
2111
!!opts -> bypass_document_validation );
2113
2112
}
2114
2113
2115
- wc = opts -> write_concern ? opts -> write_concern : collection -> write_concern ;
2116
-
2117
2114
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 )) {
2119
2116
bson_set_error (error ,
2120
2117
MONGOC_ERROR_COMMAND ,
2121
2118
MONGOC_ERROR_COMMAND_INVALID_ARG ,
@@ -2125,8 +2122,8 @@ mongoc_collection_find_and_modify_with_opts (mongoc_collection_t
2125
2122
RETURN (false);
2126
2123
}
2127
2124
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 );
2130
2127
}
2131
2128
}
2132
2129
@@ -2211,7 +2208,6 @@ mongoc_collection_find_and_modify (mongoc_collection_t *collection,
2211
2208
mongoc_find_and_modify_opts_set_update (opts , update );
2212
2209
mongoc_find_and_modify_opts_set_fields (opts , fields );
2213
2210
mongoc_find_and_modify_opts_set_flags (opts , flags );
2214
- mongoc_find_and_modify_opts_set_write_concern (opts , collection -> write_concern );
2215
2211
2216
2212
ret = mongoc_collection_find_and_modify_with_opts (collection , query , opts , reply , error );
2217
2213
mongoc_find_and_modify_opts_destroy (opts );
0 commit comments