From: Matt S Trout Date: Sun, 15 Apr 2018 20:59:07 +0000 (+0000) Subject: inline recheck code in resolveproposition to clarify logic X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=8cf755df2debdf733f2cc0797cd0aa3dd733f7af;p=scpubgit%2FDX.git inline recheck code in resolveproposition to clarify logic --- diff --git a/lib/DX/Step/ResolveProposition.pm b/lib/DX/Step/ResolveProposition.pm index cc38d4b..271e2c4 100644 --- a/lib/DX/Step/ResolveProposition.pm +++ b/lib/DX/Step/ResolveProposition.pm @@ -76,26 +76,15 @@ sub apply_to { $self->resolves, $self->depends_on, $self->actions ); return $ss->but(next_step => DX::Step::Backtrack->new) unless $hyp; - return $self->_recheck_for( - $ss->but(current_hypothesis => $hyp), - @recheck - ); -} - -sub _recheck_for { - my ($self, $old_ss, @recheck) = @_; - - return $old_ss unless @recheck; - - my $ss = $old_ss->but( + return $ss->but(current_hypothesis => $hyp) unless @recheck; + return $ss->but( + current_hypothesis => $hyp, next_step => DX::Step::EnterRecheck->new( proposition_list => \@recheck, - on_completion_step => $old_ss->next_step, + on_completion_step => $ss->next_step, on_failure_step => DX::Step::Backtrack->new, ), ); - - return $ss; } 1;