File tree Expand file tree Collapse file tree
Spatialization/include/JPLSpatial Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -115,15 +115,4 @@ namespace JPL::Algo
115115 const ElementType sum2 = Accumulate (data, ElementType (0 ), AccPow2<ElementType>{});
116116 return Math::IsNearlyEqual (static_cast <float >(sum2), 1 .0f , tolerance);
117117 }
118-
119- template <std::ranges::random_access_range Range, class Predicate >
120- JPL_INLINE void ErasePartitionUnordered (Range& container, Predicate predicate)
121- {
122- auto rangeToErase = std::ranges::partition (container, [&](auto & v)
123- {
124- return not predicate (v);
125- });
126- container.erase (rangeToErase.begin (), container.end ());
127- }
128-
129118} // namespace JPL::Algo
Original file line number Diff line number Diff line change @@ -582,7 +582,7 @@ namespace JPL
582582 inline auto SpecularRayTracing::ProcessRoutine<SceneType, SpecularPathCacheContainer>::PreprocessTraces(TraceResults<Intersection>& traces) -> TraceInfo
583583 {
584584 // Remove empty paths
585- Algo::ErasePartitionUnordered (traces.Paths , [](const auto & path) { return path.Nodes .empty (); });
585+ std::erase_if (traces.Paths , [](const auto & path) { return path.Nodes .empty (); });
586586
587587#if 0 //! not worth extra allocations to remove 1 in a million duplicate (we cull subpath duplicates later anyway)
588588 // Second, remove duplicate surface paths
@@ -597,7 +597,7 @@ namespace JPL
597597
598598 //! Note: this only removes the full paths, not the subpaths
599599 //! (subpath is a path up to Nth node/order within a full path)
600- Algo::ErasePartitionUnordered (paths, [&uniqueKeys](const auto& path)
600+ std::erase_if (paths, [&uniqueKeys](const auto& path)
601601 {
602602 return not uniqueKeys.Insert(path.Nodes.back().Hash);
603603 });
You can’t perform that action at this time.
0 commit comments