Skip to content

Commit

Permalink
Update per code review
Browse files Browse the repository at this point in the history
  • Loading branch information
pasin committed Dec 7, 2023
1 parent 7a7d0eb commit fd69c52
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions src/CBLDatabase.cc
Original file line number Diff line number Diff line change
Expand Up @@ -164,15 +164,8 @@ Retained<CBLCollection> CBLDatabase::getCollection(slice collectionName, slice s
if (!c4col) {
return nullptr;
}

auto scope = getScope(scopeName);
if (!scope) {
// Note (Edge Case):
// The scope is NULL because at the same time, its all collections including the
// the one just created were deleted on a different thread using another database.
return nullptr;
}
return createCBLCollection(c4col, scope.get());
auto scope = new CBLScope(scopeName, this);
return new CBLCollection(c4col, scope, this);
}


Expand All @@ -184,9 +177,8 @@ Retained<CBLCollection> CBLDatabase::createCollection(slice collectionName, slic

auto spec = C4Database::CollectionSpec(collectionName, scopeName);
auto c4col = c4db->createCollection(spec);

auto scope = new CBLScope(scopeName, this);
return createCBLCollection(c4col, scope);
return new CBLCollection(c4col, scope, this);
}


Expand Down

0 comments on commit fd69c52

Please sign in to comment.