Skip to content

Commit 341b511

Browse files
committed
Move all_ids implementation into DenseMap
1 parent 328d703 commit 341b511

3 files changed

Lines changed: 5 additions & 5 deletions

File tree

src/densemap.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,10 @@ impl<K: Index, V> DenseMap<K, V> {
5050
self.vec.push(val);
5151
id
5252
}
53+
54+
pub fn all_ids(&self) -> impl Iterator<Item = K> {
55+
(0..self.vec.len()).map(|id| K::from(id))
56+
}
5357
}
5458

5559
impl<K: Index, V: Clone> DenseMap<K, V> {

src/graph.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -368,10 +368,6 @@ impl GraphFiles {
368368
}
369369
}
370370
}
371-
372-
pub fn all_ids(&self) -> impl Iterator<Item = FileId> {
373-
(0..self.by_id.next_id().0).map(|id| FileId(id))
374-
}
375371
}
376372

377373
/// MTime info gathered for a file. This also models "file is absent".

src/work.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,7 @@ impl<'a> Work<'a> {
383383
}
384384

385385
pub fn want_every_file(&mut self, exclude: Option<FileId>) -> anyhow::Result<()> {
386-
for id in self.graph.files.all_ids() {
386+
for id in self.graph.files.by_id.all_ids() {
387387
if let Some(exclude) = exclude {
388388
if id == exclude {
389389
continue;

0 commit comments

Comments
 (0)