From 7d9106ea9cbb1996175badddadc50f5ef8c626ff Mon Sep 17 00:00:00 2001 From: xtaci Date: Sat, 17 May 2014 13:58:33 +0800 Subject: [PATCH] optimize astar algorithm with an extra array for fast testing openset --- include/astar.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/astar.h b/include/astar.h index 6723702d..d443441c 100644 --- a/include/astar.h +++ b/include/astar.h @@ -85,9 +85,9 @@ namespace alg { uint32_t ncol = m_grid.col(); // test wheather the (x1, y1) is the wall, we don't do stupid searching. - //if (m_grid(x1, y1) == WALL) { - // return NULL; - //} + if (m_grid(x1, y1) == WALL) { + return NULL; + } // the set of tentavie nodes to be evaluated, // initialy containing the start node