Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid using std::views::filter to fix issues with macosx-x86_64 toolchain #42076

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -90,25 +90,22 @@ std::tuple<EventPath, EventPath> PointerHoverTracker::diffEventPath(
++otherIt;
}

auto removedViews =
std::ranges::subrange{myIt, myEventPath.rend()} |
std::views::transform(
[this, &uiManager](const ShadowNode& node) -> const ShadowNode* {
return this->getLatestNode(node, uiManager);
}) |
std::views::filter([](auto n) -> bool { return n != nullptr; }) |
std::views::transform([](auto n) -> ShadowNode const& { return *n; });
EventPath removed(removedViews.begin(), removedViews.end());

auto addedViews =
std::ranges::subrange{otherIt, otherEventPath.rend()} |
std::views::transform(
[&other, &uiManager](const ShadowNode& node) -> const ShadowNode* {
return other.getLatestNode(node, uiManager);
}) |
std::views::filter([](auto n) -> bool { return n != nullptr; }) |
std::views::transform([](auto n) -> ShadowNode const& { return *n; });
EventPath added(addedViews.begin(), addedViews.end());
EventPath removed;
for (const auto& node : std::ranges::subrange{myIt, myEventPath.rend()}) {
const auto& latestNode = getLatestNode(node, uiManager);
if (latestNode != nullptr) {
removed.push_back(*latestNode);
}
}

EventPath added;
for (const auto& node :
std::ranges::subrange{otherIt, otherEventPath.rend()}) {
const auto& latestNode = other.getLatestNode(node, uiManager);
if (latestNode != nullptr) {
added.push_back(*latestNode);
}
}

return std::make_tuple(removed, added);
}
Expand Down
Loading