Commit dfe86ff3 authored by Hai Dang's avatar Hai Dang
Browse files

remove clone in dlist_arc iter_immut

parent 579c5102
Pipeline #42444 passed with stage
in 23 minutes and 50 seconds
......@@ -102,11 +102,11 @@ impl<'id, T> Node<'id, T> {
token: &GhostToken<'id>,
f: impl Fn(&T),
) {
let mut cur: Option<NodePtr<'id, T>> = Some(node.clone());
let mut cur: Option<&GhostCell<'id, Node<'id, T>>> = Some(node.as_ref());
while let Some(node) = cur {
let node: &Node<'id, T> = node.borrow(token); // immutably borrow `node` with `token`
f(&node.data);
cur = node.next.clone();
cur = node.next.as_deref();
}
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment