chiark / gitweb /
Revert "loop in reverse order - this is a better search path"
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Fri, 7 Mar 2014 17:48:30 +0000 (17:48 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Fri, 7 Mar 2014 17:48:30 +0000 (17:48 +0000)
This reverts commit 35e60acecf2f2657a3fd53f89053de9e57a0d7fe.

Doesn't actually seem to help that much.

main.c

diff --git a/main.c b/main.c
index 7cad48a..e093311 100644 (file)
--- a/main.c
+++ b/main.c
@@ -233,11 +233,11 @@ static void iterate_recurse(int i, AdjWord min) {
     optimise(!(printcounter & 0xfff));
     return;
   }
-  for (adjmatrix[i] = adjall;
+  for (adjmatrix[i] = min;
        ;
-       adjmatrix[i]--) {
+       adjmatrix[i]++) {
     iterate_recurse(i+1, adjmatrix[i]);
-    if (adjmatrix[i] == min)
+    if (adjmatrix[i] == adjall)
       return;
   }
 }