From: Matt S Trout Date: Wed, 16 Mar 2016 14:43:01 +0000 (+0000) Subject: always overwrite alternatives in case @alt has been shifted since we started X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=f7fe6f5d404520e83092a9c3226995add030fcb3;p=scpubgit%2FDX.git always overwrite alternatives in case @alt has been shifted since we started --- diff --git a/lib/DX/SearchState.pm b/lib/DX/SearchState.pm index 4d81d48..3daca33 100644 --- a/lib/DX/SearchState.pm +++ b/lib/DX/SearchState.pm @@ -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, ); }