From aecd2419708efdde9b0a1e51f8df5b7ebb8e21fb Mon Sep 17 00:00:00 2001 From: Ben Tracy Date: Mon, 8 Jan 2024 17:21:19 +0000 Subject: [PATCH] Replace additional ifs with ternary --- sycl/source/detail/graph_impl.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/sycl/source/detail/graph_impl.cpp b/sycl/source/detail/graph_impl.cpp index 6dd86c25a665e..4d46c104a70b0 100644 --- a/sycl/source/detail/graph_impl.cpp +++ b/sycl/source/detail/graph_impl.cpp @@ -414,13 +414,13 @@ graph_impl::add(const std::shared_ptr &Impl, return Handler.MSubgraphNode; } - node_type NodeType; - if (auto UserFacingType = Handler.MImpl->MUserFacingNodeType; - UserFacingType != node_type::empty) { - NodeType = UserFacingType; - } else { - NodeType = getNodeTypeFromCG(Handler.MCGType); - } + node_type NodeType = + Handler.MImpl->MUserFacingNodeType != + ext::oneapi::experimental::node_type::empty + ? Handler.MImpl->MUserFacingNodeType + : ext::oneapi::experimental::detail::getNodeTypeFromCG( + Handler.MCGType); + auto NodeImpl = this->add(NodeType, std::move(Handler.MGraphNodeCG), Dep); // Add an event associated with this explicit node for mixed usage addEventForNode(Impl, std::make_shared(), NodeImpl);