aboutsummaryrefslogtreecommitdiff
path: root/src/solvers/solutions.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/solvers/solutions.h')
-rw-r--r--src/solvers/solutions.h15
1 files changed, 3 insertions, 12 deletions
diff --git a/src/solvers/solutions.h b/src/solvers/solutions.h
index e65f299..95c1d1a 100644
--- a/src/solvers/solutions.h
+++ b/src/solvers/solutions.h
@@ -43,8 +43,6 @@ solution_list_init(solution_list_t sols[static 1], size_t n, char buf[n])
43 sols->size = n; 43 sols->size = n;
44 sols->used = 0; 44 sols->used = 0;
45 sols->buf = buf; 45 sols->buf = buf;
46
47 /* Ensure string buffer is NULL-terminated */
48 sols->buf[0] = '\0'; 46 sols->buf[0] = '\0';
49 47
50 return true; 48 return true;
@@ -215,15 +213,8 @@ solutions_done(
215 int8_t depth 213 int8_t depth
216) 214)
217{ 215{
218 if (list->nsols >= settings->maxsolutions)
219 return true;
220
221 if (depth > settings->maxmoves)
222 return true;
223 216
224 if (list->nsols > 0 && settings->optimal >= 0 && 217 return depth > settings->maxmoves ||
225 depth > list->shortest_sol + settings->optimal) 218 depth > list->shortest_sol + settings->optimal ||
226 return true; 219 list->nsols >= settings->maxsolutions;
227
228 return false;
229} 220}

Generated with cgit - Back to sebastiano.tronto.net