remove inputs method of QueryEdges

This commit is contained in:
XFFXFF 2022-09-24 01:02:29 +00:00
parent 559c02ba80
commit 1214610451
2 changed files with 10 additions and 25 deletions

View file

@ -1,7 +1,6 @@
use crate::{
hash::FxHashSet,
key::DependencyIndex,
runtime::local_state::QueryOrigin,
runtime::local_state::{EdgeKind, QueryOrigin},
storage::{HasJar, HasJarsDyn},
DatabaseKeyIndex,
};
@ -67,18 +66,15 @@ impl Stack {
match origin {
None | Some(QueryOrigin::Assigned(_)) | Some(QueryOrigin::BaseInput) => {}
Some(QueryOrigin::Derived(edges)) | Some(QueryOrigin::DerivedUntracked(edges)) => {
for DependencyIndex {
ingredient_index,
key_index,
} in edges.inputs().iter().copied()
for (_, dependency_index) in edges
.input_outputs
.iter()
.filter(|edge| edge.0 == EdgeKind::Input)
.copied()
{
if let Some(key_index) = key_index {
let i = DatabaseKeyIndex {
ingredient_index,
key_index,
};
if let Ok(i) = DatabaseKeyIndex::try_from(dependency_index) {
if self.s.insert(i) {
self.v.push(i);
self.v.push(i)
}
}
}

View file

@ -76,7 +76,7 @@ pub enum QueryOrigin {
impl QueryOrigin {
/// Indices for queries *written* by this query (or `vec![]` if its value was assigned).
pub(crate) fn outputs(&self) -> impl Iterator<Item = DependencyIndex> + '_ {
pub(crate) fn outputs(&self) -> impl Iterator<Item = DependencyIndex> {
let slice = match self {
QueryOrigin::Derived(edges) | QueryOrigin::DerivedUntracked(edges) => edges.outputs(),
QueryOrigin::Assigned(_) | QueryOrigin::BaseInput => vec![],
@ -115,18 +115,7 @@ pub struct QueryEdges {
}
impl QueryEdges {
/// Returns the (tracked) inputs that were executed in computing this memoized value.
///
/// These will always be in execution order.
pub(crate) fn inputs(&self) -> Vec<DependencyIndex> {
self.input_outputs
.iter()
.filter(|(edge_kind, _)| *edge_kind == EdgeKind::Input)
.map(|(_, dependency_index)| *dependency_index)
.collect()
}
/// Returns the (tracked) inputs that were executed in computing this memoized value.
/// Returns the (tracked) outputs that were executed in computing this memoized value.
///
/// These will always be in execution order.
pub(crate) fn outputs(&self) -> Vec<DependencyIndex> {