diff --git a/dom/src/dom/root_node.cc b/dom/src/dom/root_node.cc index b1dde8ac71a..79916b296c7 100644 --- a/dom/src/dom/root_node.cc +++ b/dom/src/dom/root_node.cc @@ -150,7 +150,10 @@ void RootNode::CreateDomNodes(std::vector>&& nodes, boo // https://doc.weixin.qq.com/doc/w3_ANsAsgZ1ACckOPazHXERJqKHOCbP1?scode=AJEAIQdfAAogJJ2RicAMgAvQZ1ACc // 排序要保证两个原则:1. 父节点在子节点前;2. 同一父节点的子节点,必须按照 index 从小到大的顺序排序 // 同一层级,不同父节点的子节点,位置可以交叉,但要保证原则2,即同一父节点子节点 index 是从小到大的顺序 - std::stable_sort(nodes_to_create.begin(), nodes_to_create.end(), [](const std::shared_ptr& a, const std::shared_ptr& b) + std::stable_sort( + nodes_to_create.begin(), + nodes_to_create.end(), + [](const std::shared_ptr& a, const std::shared_ptr& b) { auto render_info_a = a->GetRenderInfo(); auto render_info_b = b->GetRenderInfo(); diff --git a/driver/js/src/modules/scene_builder_module.cc b/driver/js/src/modules/scene_builder_module.cc index dddb4fc28a3..efc1c044e0f 100644 --- a/driver/js/src/modules/scene_builder_module.cc +++ b/driver/js/src/modules/scene_builder_module.cc @@ -438,7 +438,7 @@ std::shared_ptr> RegisterSceneBuilder(const std::wea auto nodes = HandleJsValue(scope->GetContext(), arguments[0], scope); bool needSortByIndex = false; if (argument_count == 2) { - needSortByIndex = scope->GetContext()->GetValueBoolean(arguments[1], &needSortByIndex); + scope->GetContext()->GetValueBoolean(arguments[1], &needSortByIndex); } SceneBuilder::Create(scope->GetDomManager(), scope->GetRootNode(), std::move(std::get<2>(nodes)), needSortByIndex); return nullptr;