From: Matt S Trout Date: Sun, 15 Apr 2018 20:40:45 +0000 (+0000) Subject: inline _apply_to in ResolveProposition to clarify logic X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=161534ffafd09ed5f1135e28414f345f88b26d6f;p=scpubgit%2FDX.git inline _apply_to in ResolveProposition to clarify logic --- diff --git a/lib/DX/Step/ResolveProposition.pm b/lib/DX/Step/ResolveProposition.pm index acd38d5..cc38d4b 100644 --- a/lib/DX/Step/ResolveProposition.pm +++ b/lib/DX/Step/ResolveProposition.pm @@ -71,20 +71,13 @@ sub apply_to { @{$old_ss->decisions_taken} ], ); - my $new_ss = $self->_apply_to_ss($ss); - return $ss->but(next_step => DX::Step::Backtrack->new) unless $new_ss; - return $new_ss; -} - -sub _apply_to_ss { - my ($self, $old_ss) = @_; my $old_hyp = $old_ss->current_hypothesis; (my $hyp, my @recheck) = $old_hyp->with_resolution( $self->resolves, $self->depends_on, $self->actions ); - return undef unless $hyp; + return $ss->but(next_step => DX::Step::Backtrack->new) unless $hyp; return $self->_recheck_for( - $old_ss->but(current_hypothesis => $hyp), + $ss->but(current_hypothesis => $hyp), @recheck ); }