File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change 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
33module 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 ]] );
Original file line number Diff line number Diff line change 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
1313module 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 }
You can’t perform that action at this time.
0 commit comments