diff options
Diffstat (limited to 'azalea/benches')
| -rw-r--r-- | azalea/benches/pathfinder.rs | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/azalea/benches/pathfinder.rs b/azalea/benches/pathfinder.rs index 5152e71d..3fb1c7b2 100644 --- a/azalea/benches/pathfinder.rs +++ b/azalea/benches/pathfinder.rs @@ -4,7 +4,7 @@ use azalea::{ pathfinder::{ astar::{self, a_star}, goals::BlockPosGoal, - moves::PathfinderCtx, + world::CachedWorld, Goal, }, BlockPos, @@ -79,13 +79,11 @@ fn bench_pathfinder(c: &mut Criterion) { b.iter(|| { let (world, start, end) = generate_bedrock_world(&mut partial_chunks, 4); - let ctx = PathfinderCtx::new(Arc::new(RwLock::new(world.into()))); + let cached_world = CachedWorld::new(Arc::new(RwLock::new(world.into()))); let goal = BlockPosGoal(end); let successors = |pos: BlockPos| { - let mut edges = Vec::with_capacity(16); - successors_fn(&mut edges, &ctx, pos); - edges + azalea::pathfinder::call_successors_fn(&cached_world, successors_fn, pos) }; let astar::Path { movements, partial } = a_star( |
