From ca1eeb69a48926977abcd7f151577d4af558b7ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Edelbo?= Date: Thu, 14 Mar 2024 10:38:48 +0100 Subject: [PATCH] Small optimization of CollectionBase::do_init_from_parent --- src/realm/collection.cpp | 4 ---- src/realm/list.hpp | 2 +- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/src/realm/collection.cpp b/src/realm/collection.cpp index 99553ec53ee..03e9bd4325b 100644 --- a/src/realm/collection.cpp +++ b/src/realm/collection.cpp @@ -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; diff --git a/src/realm/list.hpp b/src/realm/list.hpp index fec6505c030..989c7597e53 100644 --- a/src/realm/list.hpp +++ b/src/realm/list.hpp @@ -260,7 +260,7 @@ class Lst final : public CollectionBaseImpl { m_tree->set_parent(const_cast(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