use get_unchecked_mut for hotspot
This commit is contained in:
parent
bcbc232f41
commit
c7aeb98026
@ -253,7 +253,7 @@ impl FutureMoves {
|
|||||||
// TODO! impl dynamic sorting based on children's states, maybe it propegates
|
// TODO! impl dynamic sorting based on children's states, maybe it propegates
|
||||||
// upwards using the `parent` field
|
// upwards using the `parent` field
|
||||||
// SAFETY! the sort_by_key function should not modify anything
|
// SAFETY! the sort_by_key function should not modify anything
|
||||||
unsafe { &mut *(self as *mut Self) }.arena[idx]
|
unsafe { (&mut *(self as *mut Self)).arena.get_unchecked_mut(idx) }
|
||||||
.children
|
.children
|
||||||
// negative because we want the largest value in the first index
|
// negative because we want the largest value in the first index
|
||||||
.sort_by_key(|&x| -self.arena[x].value);
|
.sort_by_key(|&x| -self.arena[x].value);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user