Skip to content

Commit ceeb842

Browse files
authored
Minor update.
1 parent 06bad78 commit ceeb842

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

AStarD/AStar.d

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// A* (A-Star) search algorithm for 2D grids by Évan (xzripper): https://github.com/xzripper/AStarD
1+
// A* (A-Star) search algorithm for 2D grids by Evan (xzripper): https://github.com/xzripper/AStarD
22

33
module AStarD.AStar;
44

@@ -48,6 +48,8 @@ ASPath AStar(
4848
Heuristic p_Heuristic,
4949
bool p_AllowDiagonalMovement ) @safe
5050
{
51+
if ( p_Grid.length <= 1 ) { return []; }
52+
5153
Heap!Node t_NodesHeap = Heap!Node( HeapType.MIN_HEAP );
5254

5355
t_NodesHeap.HeapPush( [0, p_Start[0], p_Start[1]] );

AStarD/DHeap/Heap.d

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* It is iterable and optimized to avoid useless allocations of memory.
88
* Uses safe code and minimizes reliance on the garbage collector.
99
*
10-
* https://github.com/xzripper/DHeap by Évan
10+
* https://github.com/xzripper/DHeap by Evan
1111
*/
1212

1313
module DHeap.Heap;
@@ -111,7 +111,7 @@ struct Heap(T)
111111
return (m_HeapType == HeapType.MIN_HEAP) ? p_Object0 < p_Object1 : p_Object0 > p_Object1;
112112
}
113113

114-
T HeapFront() const @property @safe @nogc
114+
T HeapFront() @property @safe @nogc
115115
{
116116
return m_HeapData[0];
117117
}

0 commit comments

Comments
 (0)