inline recheck code in resolveproposition to clarify logic
Matt S Trout [Sun, 15 Apr 2018 20:59:07 +0000 (20:59 +0000)]
lib/DX/Step/ResolveProposition.pm

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