Skip to content

Commit 233aab3

Browse files
committed
explain that nonsense lmao
1 parent 96307f3 commit 233aab3

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

src/backend/Attributable.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -666,6 +666,12 @@ void Attributable::readAttributes(ReadMode mode)
666666

667667
void Attributable::preferCurrentBackpointer() const
668668
{
669+
/*
670+
* This is called when reopening some object as a specific type (e.g.
671+
* RecordComponent) that had originally been opened generically as
672+
* CustomHierarchy already. In this case, the specific type's pointer should
673+
* be preferred for Writable::attributable as it has more information.
674+
*/
669675
auto this_as_custom_hierarchy = dynamic_cast<CustomHierarchy const *>(this);
670676
if (this_as_custom_hierarchy)
671677
{
@@ -682,13 +688,21 @@ void Attributable::preferCurrentBackpointer() const
682688
return;
683689
}
684690

691+
// Now:
692+
// !this_as_custom_hierarchy && backpointer_as_custom_hierarchy
693+
685694
w.attributable = m_attri.get();
686695

696+
// Now:
697+
// !this_as_custom_hierarchy && !backpointer_as_custom_hierarchy
698+
687699
if (!w.parent)
688700
{
689701
throw error::Internal(
690702
"CustomHierarchy object was created without parent. Why?");
691703
}
704+
705+
// dont manage this as a customhierarchy instance
692706
auto count_of_erased_elements =
693707
(*w.parent->attributable)
694708
->m_children_managed_as_custom_hierarchy.erase(

0 commit comments

Comments
 (0)