From: Matt S Trout Date: Tue, 21 Jun 2016 19:48:18 +0000 (+0000) Subject: remove alternative addition handling from search state X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=5d243619c312a8ba979c1f05499a1842e5f65895;p=scpubgit%2FDX.git remove alternative addition handling from search state --- diff --git a/lib/DX/SearchState.pm b/lib/DX/SearchState.pm index 005aa3c..9562373 100644 --- a/lib/DX/SearchState.pm +++ b/lib/DX/SearchState.pm @@ -36,20 +36,8 @@ sub with_one_step { my ($self) = @_; my $hyp = $self->current_hypothesis; return undef unless my $step = $self->next_step; - my ($new_ss, $alt_step) = $step->apply_to($self); - if ($new_ss) { - return $new_ss->but( - alternatives => [ - ($alt_step - ? [ $hyp, $alt_step ] - : ()), - @{$new_ss->alternatives} - ], - ); - } - if ($alt_step) { - return $self->but(next_step => $alt_step); - } + my ($new_ss) = $step->apply_to($self); + return $new_ss if $new_ss; my ($first_alt, @rest_alt) = @{$self->alternatives}; return undef unless $first_alt; trace 'search.backtrack.rewind_to' => $first_alt->[1];