Skip to content

Commit 193e97b

Browse files
committed
src/search: reorder 8-way neighbors constant
Now they're accessed according to the big array's stride.
1 parent c3fb341 commit 193e97b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/search-astar.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,13 +103,13 @@ constexpr auto directions = []() constexpr
103103
constexpr auto len2 = (uint32_t)(len1.length() + 1.f); // NOLINT
104104
std::array<pair, 8> array = {{
105105
{ { -1, -1 }, len2 },
106-
{ { 1, 1 }, len2 },
107-
{ { -1, 1 }, len2 },
106+
{ { 0, -1 }, len1.y() },
108107
{ { 1, -1 }, len2 },
109108
{ { -1, 0 }, len1.x() },
110-
{ { 0, -1 }, len1.y() },
111109
{ { 1, 0 }, len1.x() },
110+
{ { -1, 1 }, len2 },
112111
{ { 0, 1 }, len1.y() },
112+
{ { 1, 1 }, len2 },
113113
}};
114114
for (auto& [vec, len] : array)
115115
vec *= div_size;

0 commit comments

Comments
 (0)