Skip to content

Commit 10ad843

Browse files
committed
let's keep the arrays
1 parent 95380a3 commit 10ad843

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

src/edge_differences.rs

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
use crate::EdgeId;
12
use crate::NodeId;
23
use crate::Position;
34
use crate::TreeSequence;
@@ -75,13 +76,26 @@ pub type EdgeRemoval = EdgeDifference<Removal>;
7576
/// Manages iteration over trees to obtain
7677
/// edge differences.
7778
pub struct EdgeDifferencesIterator<'ts> {
78-
treeseq: &'ts TreeSequence,
79+
edge_left: &'ts [Position],
80+
edge_right: &'ts [Position],
81+
edge_parent: &'ts [NodeId],
82+
edge_child: &'ts [NodeId],
83+
insertion_order: &'ts [EdgeId],
84+
removal_orderr: &'ts [EdgeId],
7985
left: f64,
8086
}
8187

8288
impl<'ts> EdgeDifferencesIterator<'ts> {
8389
pub(crate) fn new(treeseq: &'ts TreeSequence) -> Self {
84-
Self{treeseq, left: 0.}
90+
Self {
91+
edge_left: treeseq.tables().edges().left_slice(),
92+
edge_right: treeseq.tables().edges().right_slice(),
93+
edge_parent: treeseq.tables().edges().parent_slice(),
94+
edge_child: treeseq.tables().edges().child_slice(),
95+
insertion_order: treeseq.edge_insertion_order(),
96+
removal_orderr: treeseq.edge_removal_order(),
97+
left: 0.,
98+
}
8599
}
86100
}
87101

0 commit comments

Comments
 (0)