Simplify find_head_walk

This commit is contained in:
Michael Sproul
2026-04-02 14:24:37 +11:00
parent eceedaf7b6
commit 6df55970aa

View File

@@ -1232,11 +1232,7 @@ impl ProtoArray {
head = children
.into_iter()
.map(|(child, _)| -> Result<_, Error> {
let proto_node = self
.nodes
.get(child.proto_node_index)
.ok_or(Error::InvalidNodeIndex(child.proto_node_index))?;
.map(|(child, ref proto_node)| -> Result<_, Error> {
let weight = self.get_weight::<E>(
&child,
proto_node,