summaryrefslogtreecommitdiffhomepage
path: root/bench
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2024-02-04 13:57:35 +0100
committerStanislaw Halik <sthalik@misaki.pl>2024-02-04 13:59:21 +0100
commite5659516ff0df4462d1e07308152cd1ebbedf182 (patch)
tree3731dd22c62d03ac8ae8790ba9448b87d4887afe /bench
parent5b7b84462e81b5c4bbc835a12c08a4e8a11152b1 (diff)
bench/dijkstra: fix use after free
Diffstat (limited to 'bench')
-rw-r--r--bench/dijkstra.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/bench/dijkstra.cpp b/bench/dijkstra.cpp
index a50548d0..b0f1936d 100644
--- a/bench/dijkstra.cpp
+++ b/bench/dijkstra.cpp
@@ -9,13 +9,12 @@ namespace floormat {
namespace {
-auto A = astar();
-bool first_run = false;
-
void Dijkstra(benchmark::State& state)
{
(void)loader.wall_atlas_list();
auto w = world();
+ auto A = astar();
+ bool first_run = false;
constexpr auto wcx = 1, wcy = 1, wtx = 8, wty = 8, wox = 0, woy = 0;
constexpr auto max_dist = (uint32_t)(Vector2i(Math::abs(wcx)+1, Math::abs(wcy)+1)*TILE_MAX_DIM*iTILE_SIZE2).length();