@@ -1179,39 +1179,6 @@ lookup_as_int64 (
1179
1179
return false;
1180
1180
}
1181
1181
1182
- static bool
1183
- lookup_double (const bson_t * bson , const char * key , double * out , const char * source , mongoc_bulkwriteexception_t * exc )
1184
- {
1185
- BSON_ASSERT_PARAM (bson );
1186
- BSON_ASSERT_PARAM (key );
1187
- BSON_ASSERT_PARAM (out );
1188
- BSON_ASSERT (source || true);
1189
- BSON_ASSERT_PARAM (exc );
1190
-
1191
- bson_iter_t iter ;
1192
- if (bson_iter_init_find (& iter , bson , key ) && BSON_ITER_HOLDS_DOUBLE (& iter )) {
1193
- * out = bson_iter_double (& iter );
1194
- return true;
1195
- }
1196
- bson_error_t error ;
1197
- if (source ) {
1198
- bson_set_error (& error ,
1199
- MONGOC_ERROR_COMMAND ,
1200
- MONGOC_ERROR_COMMAND_INVALID_ARG ,
1201
- "expected to find double `%s` in %s, but did not" ,
1202
- key ,
1203
- source );
1204
- } else {
1205
- bson_set_error (& error ,
1206
- MONGOC_ERROR_COMMAND ,
1207
- MONGOC_ERROR_COMMAND_INVALID_ARG ,
1208
- "expected to find double `%s`, but did not" ,
1209
- key );
1210
- }
1211
- _bulkwriteexception_set_error (exc , & error );
1212
- return false;
1213
- }
1214
-
1215
1182
static bool
1216
1183
lookup_string (
1217
1184
const bson_t * bson , const char * key , const char * * out , const char * source , mongoc_bulkwriteexception_t * exc )
@@ -1688,8 +1655,8 @@ mongoc_bulkwrite_execute (mongoc_bulkwrite_t *self, const mongoc_bulkwriteopts_t
1688
1655
const bson_t * result ;
1689
1656
while (mongoc_cursor_next (reply_cursor , & result )) {
1690
1657
// Parse for `ok`.
1691
- double ok ;
1692
- if (!lookup_double (result , "ok" , & ok , "result" , ret .exc )) {
1658
+ int64_t ok ;
1659
+ if (!lookup_as_int64 (result , "ok" , & ok , "result" , ret .exc )) {
1693
1660
goto batch_fail ;
1694
1661
}
1695
1662
0 commit comments