mirror of
https://github.com/astral-sh/uv.git
synced 2025-07-07 13:25:00 +00:00
Use index instead of current selection (#155)
We can also use `swap_remove` because we're discarding the vector.
This commit is contained in:
parent
4645f79237
commit
6f52b5ca4d
1 changed files with 2 additions and 2 deletions
|
@ -286,7 +286,7 @@ impl<'a> Resolver<'a> {
|
|||
true
|
||||
}) else {
|
||||
// Short circuit: we couldn't find _any_ compatible versions for a package.
|
||||
let (package, _range) = potential_packages.remove(selection);
|
||||
let (package, _range) = potential_packages.swap_remove(index);
|
||||
return Ok((package, None));
|
||||
};
|
||||
|
||||
|
@ -301,7 +301,7 @@ impl<'a> Resolver<'a> {
|
|||
// TODO(charlie): This is really ugly, but we need to return `T`, not `&T` (and yet
|
||||
// we also need to iterate over `potential_packages` multiple times, so we can't
|
||||
// use `into_iter()`.)
|
||||
let (package, range) = potential_packages.remove(selection);
|
||||
let (package, range) = potential_packages.swap_remove(selection);
|
||||
|
||||
return match package.borrow() {
|
||||
PubGrubPackage::Root => Ok((package, Some(MIN_VERSION.clone()))),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue