improve update_root_coord
This commit is contained in:
parent
937a48f230
commit
8842bf6087
@ -262,9 +262,14 @@ impl FutureMoves {
|
||||
self.arena
|
||||
.iter()
|
||||
.enumerate()
|
||||
.find_map(|(idx, node)| {
|
||||
(node.parent == self.current_root && node.i == i && node.j == j).then_some(idx)
|
||||
.filter(|(_, node)| {
|
||||
node.parent == self.current_root
|
||||
&& self.current_root.is_some()
|
||||
&& node.i == i
|
||||
&& node.j == j
|
||||
})
|
||||
.next()
|
||||
.map(|x| x.0)
|
||||
.inspect(|&root| self.update_root_idx(root))
|
||||
.is_some()
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user