Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions src/mongocxx/lib/mongocxx/v1/client_encryption.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,6 @@ struct encrypt_opts_deleter {
using encrypt_opts_ptr_type = std::unique_ptr<mongoc_client_encryption_encrypt_opts_t, encrypt_opts_deleter>;

encrypt_opts_ptr_type to_mongoc(v1::encrypt_options const& opts) {
struct encrypt_opts_deleter {
void operator()(mongoc_client_encryption_encrypt_opts_t* ptr) noexcept {
libmongoc::client_encryption_encrypt_opts_destroy(ptr);
}
};

auto ret = encrypt_opts_ptr_type{libmongoc::client_encryption_encrypt_opts_new()};
auto const ptr = ret.get();

Expand Down
6 changes: 4 additions & 2 deletions src/mongocxx/lib/mongocxx/v1/indexes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,8 @@ bsoncxx::v1::stdx::optional<std::string> create_one_impl(
// SERVER-78611: sharded clusters may place fields in a raw response document instead of in
// the top-level document.
if (auto const raw = reply_owner.view()["raw"]) {
auto const shard_response = raw.get_document().view();

// There should only be a single field in the raw response with the shard connection
// string as the key. e.g.:
// {
Expand All @@ -256,8 +258,8 @@ bsoncxx::v1::stdx::optional<std::string> create_one_impl(
// }
// }
// Using a for loop for convenience.
for (auto const& shard_response : raw.get_document().view()) {
return shard_response.get_document().view();
for (auto const e : shard_response) {
return e.get_document().view();
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,6 @@ struct encrypt_opts_deleter {
using encrypt_opts_ptr_type = std::unique_ptr<mongoc_client_encryption_encrypt_opts_t, encrypt_opts_deleter>;

encrypt_opts_ptr_type to_mongoc(v_noabi::options::encrypt const& opts) {
struct encrypt_opts_deleter {
void operator()(mongoc_client_encryption_encrypt_opts_t* ptr) noexcept {
libmongoc::client_encryption_encrypt_opts_destroy(ptr);
}
};

auto ret = encrypt_opts_ptr_type{libmongoc::client_encryption_encrypt_opts_new()};
auto const ptr = ret.get();

Expand Down
6 changes: 4 additions & 2 deletions src/mongocxx/lib/mongocxx/v_noabi/mongocxx/index_view.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,8 @@ bsoncxx::v1::stdx::optional<std::string> create_one_impl(
// SERVER-78611: sharded clusters may place fields in a raw response document instead of in
// the top-level document.
if (auto const raw = reply_owner.view()["raw"]) {
auto const shard_response = raw.get_document().view();

// There should only be a single field in the raw response with the shard connection
// string as the key. e.g.:
// {
Expand All @@ -146,8 +148,8 @@ bsoncxx::v1::stdx::optional<std::string> create_one_impl(
// }
// }
// Using a for loop for convenience.
for (auto const& shard_response : raw.get_document().view()) {
return shard_response.get_document().view();
for (auto const e : shard_response) {
return e.get_document().view();
}
}

Expand Down