节点重新排序时增加节点ID的重复性校验

Signed-off-by: wangxinqiang007 <wangxinqiang2@huawei.com>
This commit is contained in:
wangxinqiang007 2024-01-05 11:02:48 +08:00
parent 6f456d7167
commit ba4dc850e9

View File

@ -503,7 +503,9 @@ void AccessibleAbilityClientImpl::SortElementInfosIfNecessary(std::vector<Access
sortedElementInfos.push_back(*(iter->second));
std::vector<int64_t> childNodeIds = iter->second->GetChildIds();
for (auto &id : childNodeIds) {
elementList.push_back(id);
if (std::find(elementList.begin(), elementList.end(), id) == elementList.end()) {
elementList.push_back(id);
}
}
index++;
}