瀏覽代碼

state link stack size is wrongly checked twice if no link is found

Baglio Tabifata 4 年之前
父節點
當前提交
639f4f5b9d
共有 1 個文件被更改,包括 5 次插入6 次删除
  1. 5 6
      src/main/java/info/hkzlab/dupal/analyzer/board/boardio/DuPALAnalyzer.java

+ 5 - 6
src/main/java/info/hkzlab/dupal/analyzer/board/boardio/DuPALAnalyzer.java

@@ -321,7 +321,7 @@ public class DuPALAnalyzer {
     }
 
     private StateLink[] internal_searchPath(MacroState start, MacroState dest) {
-        logger.info("Searching from a path from ["+start+"] to ["+dest+"]");
+        logger.info("Searching for a path from ["+start+"] to ["+dest+"]");
 
         Stack<StateLink> slStack = new Stack<>();
         Set<MacroState> msSet = new HashSet<>();
@@ -368,11 +368,10 @@ public class DuPALAnalyzer {
                     } else curMS = start; // Back at the beginning it seems...
                     logger.trace("Moved back to ["+curMS+"]");
 
-                } else return null; 
-                
-                if(slStack.size() > 0) {
-
-                } else return null; // Found no possible path
+                } else {
+                    logger.info("Found no possible path out of [" + start + "] to another unvisited link.");
+                    return null;  // Found no possible path
+                }
             }
 
         }