mirror of
https://github.com/astral-sh/uv.git
synced 2025-10-02 23:04:37 +00:00
Deduplicate markers during normalization (#4263)
## Summary We need to sort _before_ deduplicating; otherwise, we can't detect adjacent elements, so we aren't guaranteed to deduplicate anything.
This commit is contained in:
parent
cc2e9ec111
commit
8a8e1af513
1 changed files with 2 additions and 2 deletions
|
@ -123,8 +123,8 @@ pub(crate) fn normalize(tree: &mut MarkerTree) {
|
||||||
.fold(PubGrubRange::full(), |acc, range| acc.intersection(range))
|
.fold(PubGrubRange::full(), |acc, range| acc.intersection(range))
|
||||||
});
|
});
|
||||||
|
|
||||||
reduced.dedup();
|
|
||||||
reduced.sort();
|
reduced.sort();
|
||||||
|
reduced.dedup();
|
||||||
|
|
||||||
*tree = match reduced.len() {
|
*tree = match reduced.len() {
|
||||||
1 => reduced.remove(0),
|
1 => reduced.remove(0),
|
||||||
|
@ -138,8 +138,8 @@ pub(crate) fn normalize(tree: &mut MarkerTree) {
|
||||||
.fold(PubGrubRange::empty(), |acc, range| acc.union(range))
|
.fold(PubGrubRange::empty(), |acc, range| acc.union(range))
|
||||||
});
|
});
|
||||||
|
|
||||||
reduced.dedup();
|
|
||||||
reduced.sort();
|
reduced.sort();
|
||||||
|
reduced.dedup();
|
||||||
|
|
||||||
*tree = match reduced.len() {
|
*tree = match reduced.len() {
|
||||||
1 => reduced.remove(0),
|
1 => reduced.remove(0),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue