diff options
| author | mat <git@matdoes.dev> | 2023-10-08 15:34:41 -0500 |
|---|---|---|
| committer | mat <git@matdoes.dev> | 2023-10-08 15:34:41 -0500 |
| commit | 0297b8aacee27d9e86cea781b3751591e32df401 (patch) | |
| tree | 058fa11e12fc88dc705b97be933aa7e246575e7d /azalea/benches | |
| parent | f10535b5c80ab5e4c7fe524c0e822352e45e8ce8 (diff) | |
| download | azalea-drasl-0297b8aacee27d9e86cea781b3751591e32df401.tar.xz | |
PathfinderCtx
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( |
