Skip to content

Commit

Permalink
[perf] optimize addElement function, optimize belong.
Browse files Browse the repository at this point in the history
  • Loading branch information
ChunelFeng committed Nov 29, 2024
1 parent c5a869f commit bf0bd07
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/GraphCtrl/GraphElement/GGroup/GGroup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ CStatus GGroup::addElement(GElementPtr element) {
CGRAPH_ASSERT_NOT_NULL(element)

this->group_elements_arr_.emplace_back(element);
element->belong_ = this;
element->addManagers(param_manager_, event_manager_);
CGRAPH_FUNCTION_END
}

Expand Down
1 change: 1 addition & 0 deletions src/GraphCtrl/GraphElement/GGroup/GRegion/GRegion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ CStatus GRegion::addElement(GElementPtr element) {
CGRAPH_ASSERT_NOT_NULL(element, manager_)

manager_->manager_elements_.emplace(element);
status = GGroup::addElement(element);
CGRAPH_FUNCTION_END
}

Expand Down
1 change: 0 additions & 1 deletion src/GraphCtrl/GraphPipeline/GPipeline.inl
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,6 @@ TGroup* GPipeline::createGGroup(const GElementPtrArr &elements,
auto* group = CGRAPH_SAFE_MALLOC_COBJECT(TGroup)
for (GElementPtr element : elements) {
status += group->addElement(element);
element->belong_ = group; // 从属于这个group的信息
}
CGRAPH_THROW_EXCEPTION_BY_STATUS(status)

Expand Down

0 comments on commit bf0bd07

Please sign in to comment.