Constructs a new `LexRequirement` from the given sort requirements w/o enforcing non-degeneracy. This function is used internally and is not meant (or safe) for external use.
(
reqs: impl IntoIterator<Item = PhysicalSortRequirement>,
)
| 615 | /// enforcing non-degeneracy. This function is used internally and is not |
| 616 | /// meant (or safe) for external use. |
| 617 | fn construct( |
| 618 | reqs: impl IntoIterator<Item = PhysicalSortRequirement>, |
| 619 | ) -> (bool, Self) { |
| 620 | let mut set = HashSet::new(); |
| 621 | let reqs = reqs |
| 622 | .into_iter() |
| 623 | .filter_map(|r| set.insert(Arc::clone(&r.expr)).then_some(r)) |
| 624 | .collect(); |
| 625 | (!set.is_empty(), Self { reqs }) |
| 626 | } |
| 627 | } |
| 628 | |
| 629 | impl<const N: usize> From<[PhysicalSortRequirement; N]> for LexRequirement { |