Skip to content

Commit

Permalink
Remove unnessary retaining database
Browse files Browse the repository at this point in the history
As database in collection will not be invalidated anymore, we don’t need to explicitly retaining the database in a couple of places.
  • Loading branch information
pasin committed Dec 7, 2023
1 parent 8eb3ab4 commit bdb288d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/CBLCollection.cc
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ namespace cbl_internal {
change.collection = _collection;
change.docID = _docID;

Retained<CBLDatabase> db = _collection->database();
auto db = _collection->database();
db->notify(this, change);
}

Expand Down
3 changes: 1 addition & 2 deletions src/CBLCollection_Internal.hh
Original file line number Diff line number Diff line change
Expand Up @@ -217,8 +217,7 @@ private:
}

void collectionChanged() {
Retained<CBLDatabase> db = database();
db->notify(std::bind(&CBLCollection::callCollectionChangeListeners, this));
_database->notify(std::bind(&CBLCollection::callCollectionChangeListeners, this));
}

void callCollectionChangeListeners() {
Expand Down

0 comments on commit bdb288d

Please sign in to comment.