Uploaded image for project: 'C++ Driver'
  1. C++ Driver
  2. CXX-1499

Don't access bson_iter_t internals

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.4.0
    • Component/s: None
    • Labels:
      None

      Description

      We current access the internals of the bson_iter_t structure (see CDRIVER-2467 for details). Once the C driver provides a mechanism to address this, use it.]

      Let's add a libbson function bson_iter_keylen which returns the length of the key. This is already known, it's something like "key - d1". The C++ iterator can store this length before destroying the bson_iter_t, then pass it back into a new libbson function like bson_iter_init_with_data. That will end up doing only one key-length calculation per iterator increment, whereas right now the C++ Driver does two.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: