Skip to content

Commit c715397

Browse files
committed
CDRIVER-1522 reorder cursor_new_with_opts signature
Update signature for consistency with mongoc_collection_count_with_opts: (collection, filter, opts, read_prefs)
1 parent 279c7fe commit c715397

File tree

3 files changed

+15
-13
lines changed

3 files changed

+15
-13
lines changed

src/mongoc/mongoc-collection.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -557,9 +557,8 @@ mongoc_collection_find_with_opts (mongoc_collection_t *collection,
557557
}
558558

559559
return _mongoc_cursor_new_with_opts (collection->client, collection->ns,
560-
false /* is_command */,
561-
filter, read_prefs,
562-
collection->read_concern, opts);
560+
false /* is_command */, filter, opts,
561+
read_prefs, collection->read_concern);
563562
}
564563

565564

src/mongoc/mongoc-cursor-private.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,10 +101,11 @@ mongoc_cursor_t *_mongoc_cursor_new_with_opts (mongoc_client_t
101101
const char *db_and_collection,
102102
bool is_command,
103103
const bson_t *filter,
104+
const bson_t *opts,
104105
const mongoc_read_prefs_t *read_prefs,
105-
const mongoc_read_concern_t *read_concern,
106-
const bson_t *opts);
107-
mongoc_cursor_t * _mongoc_cursor_new (mongoc_client_t *client,
106+
const mongoc_read_concern_t *read_concern);
107+
mongoc_cursor_t *
108+
_mongoc_cursor_new (mongoc_client_t *client,
108109
const char *db_and_collection,
109110
mongoc_query_flags_t flags,
110111
uint32_t skip,

src/mongoc/mongoc-cursor.c

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -218,9 +218,9 @@ _mongoc_cursor_new_with_opts (mongoc_client_t *client,
218218
const char *db_and_collection,
219219
bool is_command,
220220
const bson_t *filter,
221+
const bson_t *opts,
221222
const mongoc_read_prefs_t *read_prefs,
222-
const mongoc_read_concern_t *read_concern,
223-
const bson_t *opts)
223+
const mongoc_read_concern_t *read_concern)
224224
{
225225
mongoc_cursor_t *cursor;
226226
mongoc_topology_description_type_t td_type;
@@ -429,15 +429,17 @@ _mongoc_cursor_new (mongoc_client_t *client,
429429
done:
430430

431431
if (error.domain != 0) {
432-
cursor = _mongoc_cursor_new_with_opts (
433-
client, db_and_collection, is_command, NULL, NULL, NULL, NULL);
432+
cursor = _mongoc_cursor_new_with_opts (client, db_and_collection,
433+
is_command, NULL, NULL, NULL,
434+
NULL);
434435

435436
MARK_FAILED (cursor);
436437
memcpy (&cursor->error, &error, sizeof (bson_error_t));
437438
} else {
438-
cursor = _mongoc_cursor_new_with_opts (
439-
client, db_and_collection, is_command, has_filter ? &filter : query,
440-
read_prefs, read_concern, &opts);
439+
cursor = _mongoc_cursor_new_with_opts (client, db_and_collection,
440+
is_command,
441+
has_filter ? &filter : query,
442+
&opts, read_prefs, read_concern);
441443

442444
if (slave_ok) {
443445
cursor->slave_ok = true;

0 commit comments

Comments
 (0)