inline _apply_to in ResolveProposition to clarify logic
Matt S Trout [Sun, 15 Apr 2018 20:40:45 +0000 (20:40 +0000)]
lib/DX/Step/ResolveProposition.pm

index acd38d5..cc38d4b 100644 (file)
@@ -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
   );
 }