Allow for bigger indices in VisitChildrenResult

The indexes stored in `VisitChildrenResult` are unsigned. We have 64
bits to store two values and we need to have one special value as a flag.

So accept any index `< u32::MAX` instead of `< i32::MAX`, which should
allow for more data to be visited;-)
This commit is contained in:
Tobias Hunger 2022-01-05 15:37:34 +01:00 committed by Tobias Hunger
parent d13067db04
commit 79e2456ead
3 changed files with 15 additions and 15 deletions

View file

@ -695,16 +695,16 @@ public:
viewport_height->set(h);
}
intptr_t visit(TraversalOrder order, private_api::ItemVisitorRefMut visitor) const
uintptr_t visit(TraversalOrder order, private_api::ItemVisitorRefMut visitor) const
{
for (std::size_t i = 0; i < inner->data.size(); ++i) {
int index = order == TraversalOrder::BackToFront ? i : inner->data.size() - 1 - i;
auto ref = item_at(index);
if (ref.vtable->visit_children_item(ref, -1, order, visitor) != -1) {
if (ref.vtable->visit_children_item(ref, -1, order, visitor) != std::numeric_limits<uint64_t>::max()) {
return index;
}
}
return -1;
return std::numeric_limits<uint64_t>::max();
}
vtable::VRef<private_api::ComponentVTable> item_at(int i) const