From: Matt S Trout Date: Sat, 25 Jun 2016 16:47:36 +0000 (+0000) Subject: use is_solution_state flag in find_solution X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=282b1d7631514e792312e5ab8cadfb533f385b53;p=scpubgit%2FDX.git use is_solution_state flag in find_solution --- diff --git a/lib/DX/SearchProcess.pm b/lib/DX/SearchProcess.pm index 437f71d..cb50a2f 100644 --- a/lib/DX/SearchProcess.pm +++ b/lib/DX/SearchProcess.pm @@ -27,7 +27,7 @@ sub with_one_step { sub find_solution { my ($self) = @_; my $state = $self->current_search_state; - while ($state and $state->next_proposition) { + while ($state and (not $state->is_solution_state)) { $state = $state->with_one_step; } return undef unless $state; diff --git a/lib/DX/Step/Backtrack.pm b/lib/DX/Step/Backtrack.pm index f211c73..5fdfbc7 100644 --- a/lib/DX/Step/Backtrack.pm +++ b/lib/DX/Step/Backtrack.pm @@ -13,7 +13,7 @@ sub apply_to { current_hypothesis => $first_alt->[0], alternatives => \@rest_alt, next_step => $first_alt->[1], - is_solution_step => 0, + is_solution_state => 0, ); }