Skip to content

Commit

Permalink
Small optimization of CollectionBase::do_init_from_parent
Browse files Browse the repository at this point in the history
  • Loading branch information
jedelbo committed Mar 14, 2024
1 parent 687bb98 commit ca1eeb6
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
4 changes: 0 additions & 4 deletions src/realm/collection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -243,10 +243,6 @@ UpdateStatus CollectionBase::do_init_from_parent(BPlusTreeBase* tree, ref_type r
tree->init_from_ref(ref);
}
else {
if (tree->init_from_parent()) {
// All is well
return UpdateStatus::Updated;
}
if (!allow_create) {
tree->detach();
return UpdateStatus::Detached;
Expand Down
2 changes: 1 addition & 1 deletion src/realm/list.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ class Lst final : public CollectionBaseImpl<LstBase> {
m_tree->set_parent(const_cast<ArrayParent*>(parent), 0);
}
Base::update_content_version();
return do_init_from_parent(m_tree.get(), 0, allow_create);
return do_init_from_parent(m_tree.get(), Base::get_collection_ref(), allow_create);
}

template <class Func>
Expand Down

0 comments on commit ca1eeb6

Please sign in to comment.