Skip to content

Commit

Permalink
Fix per code review
Browse files Browse the repository at this point in the history
* Removed an extra line in ReplicatorEETest.cc.
* Fixed typos in comments in CBLCollection.cc.
* Minor fix in CBLReplicatorConfig.hh.
  • Loading branch information
pasin committed Apr 11, 2024
1 parent de6ad13 commit 2d4f0a9
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/CBLCollection.cc
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ namespace cbl_internal {
Retained<CBLListenerToken> CBLCollection::addChangeListener(CBLCollectionChangeListener listener,
void* _cbl_nullable ctx)
{
auto lock =_c4col.useLocked(); // Ensure the database lifetime while creating the Listener oken
auto lock =_c4col.useLocked(); // Ensure the database lifetime while creating the Listener token
auto token = addListener([&] { return new ListenerToken<CBLCollectionChangeListener>(this, listener, ctx); });
_listeners.add((ListenerToken<CBLCollectionChangeListener>*)token.get());
return token;
Expand All @@ -118,7 +118,7 @@ Retained<CBLListenerToken> CBLCollection::addDocumentListener(slice docID,
CBLCollectionDocumentChangeListener listener,
void* _cbl_nullable ctx)
{
auto lock =_c4col.useLocked(); // // Ensure the database lifetime while creating the Listener oken
auto lock =_c4col.useLocked(); // // Ensure the database lifetime while creating the Listener token
auto token = new ListenerToken<CBLCollectionDocumentChangeListener>(this, docID, listener, ctx);
_docListeners.add(token);
return token;
Expand Down
6 changes: 3 additions & 3 deletions src/CBLReplicatorConfig.hh
Original file line number Diff line number Diff line change
Expand Up @@ -184,11 +184,11 @@ namespace cbl_internal
// Throw an exception if the validation failed:
validate();

CBLCollection* defaultCollection = nullptr;
Retained<CBLCollection> defaultCollection = nullptr;
if (database) {
// This can technically throw if the default collection doesn't exist (We don't allow now).
// So call first before copying anything:
defaultCollection = database->getDefaultCollection(true).get();
defaultCollection = database->getDefaultCollection(true);
}

if (endpoint) {
Expand Down Expand Up @@ -229,7 +229,7 @@ namespace cbl_internal
collections = _effectiveCollections.data();
} else {
// Create a replication collection using the default collection:
assert(defaultCollection != nullptr);
assert(defaultCollection);
CBLReplicationCollection col {};
col.collection = defaultCollection;
col.conflictResolver = conflictResolver;
Expand Down
1 change: 0 additions & 1 deletion test/ReplicatorEETest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -639,7 +639,6 @@ TEST_CASE_METHOD(ReplicatorLocalTest, "DocIDs Pull Filters", "[Replicator]") {
FLMutableArray_Release(docIDs);
}


class ReplicatorFilterTest : public ReplicatorLocalTest {
public:
int count = 0;
Expand Down

0 comments on commit 2d4f0a9

Please sign in to comment.