From: Matt S Trout Date: Sun, 26 Jun 2016 17:33:48 +0000 (+0000) Subject: move recheck to post-all-actions rather than per-action X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=scpubgit%2FDX.git;a=commitdiff_plain;h=9e8ed9aeb93760a17572c749bfaf18d459e895c3 move recheck to post-all-actions rather than per-action --- diff --git a/lib/DX/Hypothesis.pm b/lib/DX/Hypothesis.pm index db9364f..0386cd0 100644 --- a/lib/DX/Hypothesis.pm +++ b/lib/DX/Hypothesis.pm @@ -24,13 +24,14 @@ has action_policy => (is => 'ro', isa => ActionPolicy, required => 1); sub with_actions { my ($self, @actions) = @_; my $hyp = $self; + my @events; foreach my $act (@actions) { return undef unless $self->action_policy->allows($act); - ($hyp, my @events) = $act->dry_run($hyp); - return undef unless $hyp; - $hyp = $hyp->but_recheck_for(@events); + ($hyp, my @these_events) = $act->dry_run($hyp); return undef unless $hyp; + push @events, @these_events; } + $hyp = $hyp->but_recheck_for(@events); return $hyp; }