mirror of
https://github.com/astral-sh/uv.git
synced 2025-10-23 08:41:48 +00:00
Refactor candidate selector for batch prefetching (#2832)
Batch prefetching needs more information from the candidate selector, so i've split `select` into methods. Split out from #2452. No functional changes.
This commit is contained in:
parent
a0b8d1a994
commit
5474c61fed
2 changed files with 70 additions and 38 deletions
|
@ -152,7 +152,9 @@ impl VersionMap {
|
|||
/// which can be used to lazily request a [`CompatibleDist`]. This is
|
||||
/// useful in cases where one can skip materializing a full distribution
|
||||
/// for each version.
|
||||
pub(crate) fn iter(&self) -> impl DoubleEndedIterator<Item = (&Version, VersionMapDistHandle)> {
|
||||
pub(crate) fn iter(
|
||||
&self,
|
||||
) -> impl DoubleEndedIterator<Item = (&Version, VersionMapDistHandle)> + ExactSizeIterator {
|
||||
match self.inner {
|
||||
VersionMapInner::Eager(ref map) => {
|
||||
either::Either::Left(map.iter().map(|(version, dist)| {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue