s/in_index/input_index/

This commit is contained in:
Niko Matsakis 2017-02-03 06:09:47 -05:00
parent ef9ae8581f
commit afbf6c8246
2 changed files with 7 additions and 7 deletions

View File

@ -7,11 +7,11 @@ pub struct DagId {
}
impl DagId {
pub fn from_in_index(n: NodeIndex) -> Self {
pub fn from_input_index(n: NodeIndex) -> Self {
DagId { index: n.0 as u32 }
}
pub fn as_in_index(&self) -> NodeIndex {
pub fn as_input_index(&self) -> NodeIndex {
NodeIndex(self.index as usize)
}
}

View File

@ -89,7 +89,7 @@ impl<'q, N, I, O> GraphReduce<'q, N, I, O>
// correspond to the indices from the input graph
for i in 0..in_graph.len_nodes() {
let k = unify.new_key(());
assert!(k == DagId::from_in_index(NodeIndex(i)));
assert!(k == DagId::from_input_index(NodeIndex(i)));
}
GraphReduce { in_graph, unify, is_input, is_output }
@ -105,8 +105,8 @@ impl<'q, N, I, O> GraphReduce<'q, N, I, O>
}
fn mark_cycle(&mut self, in_node1: NodeIndex, in_node2: NodeIndex) {
let dag_id1 = DagId::from_in_index(in_node1);
let dag_id2 = DagId::from_in_index(in_node2);
let dag_id1 = DagId::from_input_index(in_node1);
let dag_id2 = DagId::from_input_index(in_node2);
self.unify.union(dag_id1, dag_id2);
}
@ -114,8 +114,8 @@ impl<'q, N, I, O> GraphReduce<'q, N, I, O>
/// be a no-op unless `in_node` participates in a cycle, in which
/// case a distinct node *may* be returned.
fn cycle_head(&mut self, in_node: NodeIndex) -> NodeIndex {
let i = DagId::from_in_index(in_node);
self.unify.find(i).as_in_index()
let i = DagId::from_input_index(in_node);
self.unify.find(i).as_input_index()
}
#[cfg(test)]