diff options
| author | Kirill Petrashin <kirill8201@yandex.ru> | 2026-04-21 18:27:53 +0300 |
|---|---|---|
| committer | Kirill Petrashin <kirill8201@yandex.ru> | 2026-04-21 18:27:53 +0300 |
| commit | 8282175440876b28d431167ee0702404b09bf2e6 (patch) | |
| tree | 317534209153cbbf59791aabcb89bbcbfbf10e69 /path.c | |
| parent | 338353777c95d23bb93066e53364b13f46b51964 (diff) | |
| download | astar-8282175440876b28d431167ee0702404b09bf2e6.tar.xz | |
Remove path_length() as it's unused and is obsolete
Diffstat (limited to 'path.c')
| -rw-r--r-- | path.c | 16 |
1 files changed, 0 insertions, 16 deletions
@@ -309,22 +309,6 @@ size_t diagonal_distance(Position a, Position b) { return COST_ORTHOGONAL * (dx + dy) + (COST_DIAGONAL - 2 * COST_ORTHOGONAL) * min; } -size_t path_length(Path path, Position start, Position goal) { - size_t length = 0; - if (path != NULL) { - Position cur = goal; - while (cur.x != start.x || cur.y != start.y) { - if (cur.x - path[cur.y][cur.x].x == 0 || cur.y - path[cur.y][cur.x].y == 0) { - length += COST_ORTHOGONAL; - } else { - length += COST_DIAGONAL; - } - cur = path[cur.y][cur.x]; - } - } - return length; -} - Path path_new(size_t width, size_t height) { Path path = malloc(sizeof(Position*)*height); if (path == NULL) return NULL; |
