pass slice instead of vector

This commit is contained in:
Folkert 2021-11-14 19:39:03 +01:00
parent 1c6fab7043
commit cb55f66b5b

View file

@ -422,7 +422,7 @@ fn gather_edges<'a>(
// TODO remove clone // TODO remove clone
let all_edges = relevant_tests let all_edges = relevant_tests
.into_iter() .into_iter()
.map(|t| edges_for(path, branches.clone(), t)) .map(|t| edges_for(path, &branches, t))
.collect(); .collect();
let fallbacks = if check { let fallbacks = if check {
@ -583,7 +583,7 @@ fn test_at_path<'a>(
// understanding: if the test is successful, where could we go? // understanding: if the test is successful, where could we go?
fn edges_for<'a>( fn edges_for<'a>(
path: &[PathInstruction], path: &[PathInstruction],
branches: Vec<Branch<'a>>, branches: &[Branch<'a>],
test: GuardedTest<'a>, test: GuardedTest<'a>,
) -> (GuardedTest<'a>, Vec<Branch<'a>>) { ) -> (GuardedTest<'a>, Vec<Branch<'a>>) {
let mut new_branches = Vec::new(); let mut new_branches = Vec::new();