always overwrite alternatives in case @alt has been shifted since we started
Matt S Trout [Wed, 16 Mar 2016 14:43:01 +0000 (14:43 +0000)]
lib/DX/SearchState.pm

index 4d81d48..3daca33 100644 (file)
@@ -29,12 +29,12 @@ sub with_one_step {
       if ($new_hyp) {
         return $self->but(
           current_hypothesis => $new_hyp,
-          ($alt_step
-             ? (alternatives => [
-                  [ $hyp, $alt_step ],
-                  @alt
-               ])
-             : ()),
+          alternatives => [
+            ($alt_step
+              ? [ $hyp, $alt_step ]
+              : ()),
+            @alt
+          ],
           resume_step => undef,
         );
       }