Uploaded image for project: 'C Driver'
  1. C Driver
  2. CDRIVER-4373

Do not call mongoc_bulk_operation_set_let unnecessarily

    • Type: Icon: Task Task
    • Resolution: Fixed
    • Priority: Icon: Minor - P4 Minor - P4
    • 1.22.0, 1.22.0-beta0
    • Affects Version/s: None
    • Component/s: Bulk API
    • None

      mongoc_collection_create_bulk_operation_with_opts always calls mongoc_bulk_operation_set_let. If the let option was never specified, this is redundant as mongoc_bulk_operation_new already initializes it to an empty BSON document. Instead, we should gate the setter with a bson_empty check:

      if (!bson_empty (&bulk_opts.let)) {
         mongoc_bulk_operation_set_let (bulk, &bulk_opts.let);
      }
      

            Assignee:
            jmikola@mongodb.com Jeremy Mikola
            Reporter:
            jmikola@mongodb.com Jeremy Mikola
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: