From: Matt S Trout Date: Sat, 11 Feb 2017 22:12:45 +0000 (+0000) Subject: excise non-functioning depency group system X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=8c6c955154351eb1b049869d4c9f038155cdd00d;p=scpubgit%2FDX.git excise non-functioning depency group system --- diff --git a/lib/DX/DependencyMap.pm b/lib/DX/DependencyMap.pm index 1a34208..a38925f 100644 --- a/lib/DX/DependencyMap.pm +++ b/lib/DX/DependencyMap.pm @@ -23,7 +23,7 @@ sub with_entry_for { $for_id => $deps_for, }; my $new_deps = $self->_merge_deps_for( - $self->deps, $for_id, map @{$_}[1..$#$_], @$deps_for + $self->deps, $for_id, @$deps_for ); ref($self)->new( deps => $new_deps, @@ -36,7 +36,7 @@ sub without_entries_for { my %new_revdeps = %{$self->revdeps}; my $new_deps = $self->deps; $new_deps = $self->_unmerge_deps_for( - $new_deps, $_, map @{$_}[1..$#$_], @{$new_revdeps{$_}} + $new_deps, $_, @{$new_revdeps{$_}} ) for @for_ids; delete @new_revdeps{@for_ids}; ref($self)->new( diff --git a/lib/DX/Predicate/Dict.pm b/lib/DX/Predicate/Dict.pm index 4a5628a..3bbe0a6 100644 --- a/lib/DX/Predicate/Dict.pm +++ b/lib/DX/Predicate/Dict.pm @@ -12,7 +12,7 @@ sub _possible_resolution_list { unless $arg->isa('DX::Value::Dict'); return step( actions => [], - depends_on => [ [ undef ,=> [ TYPE_OF ,=> $arg ] ] ] + depends_on => [ [ TYPE_OF ,=> $arg ] ] ); } if ($proto and not $proto->isa('DX::Value::Dict')) { @@ -21,7 +21,7 @@ sub _possible_resolution_list { my $set = $arg->action_for_set_value($proto||dict()); return step( actions => [ $set ], - depends_on => [ [ undef ,=> [ TYPE_OF ,=> $arg ] ] ] + depends_on => [ [ TYPE_OF ,=> $arg ] ] ); } diff --git a/lib/DX/Predicate/Eq.pm b/lib/DX/Predicate/Eq.pm index 60bcd42..b5db3a5 100644 --- a/lib/DX/Predicate/Eq.pm +++ b/lib/DX/Predicate/Eq.pm @@ -11,7 +11,7 @@ sub _possible_resolution_list { return step( actions => [], depends_on => [ - [ undef ,=> [ CONTENTS_OF ,=> $left ], [ CONTENTS_OF ,=> $right ] ] + [ CONTENTS_OF ,=> $left ], [ CONTENTS_OF ,=> $right ] ], ); } @@ -21,9 +21,7 @@ sub _possible_resolution_list { step( actions => [ $set ], depends_on => [ - [ $right => - [ CONTENTS_OF ,=> $left ], [ CONTENTS_OF ,=> $right ] - ] + [ CONTENTS_OF ,=> $left ], [ CONTENTS_OF ,=> $right ] ] ) } else { @@ -35,9 +33,7 @@ sub _possible_resolution_list { step( actions => [ $set ], depends_on => [ - [ $left => - [ CONTENTS_OF ,=> $left ], [ CONTENTS_OF ,=> $right ] - ] + [ CONTENTS_OF ,=> $left ], [ CONTENTS_OF ,=> $right ] ] ) } else { diff --git a/lib/DX/Predicate/MemberAt.pm b/lib/DX/Predicate/MemberAt.pm index d999e77..e01f9d4 100644 --- a/lib/DX/Predicate/MemberAt.pm +++ b/lib/DX/Predicate/MemberAt.pm @@ -13,14 +13,10 @@ sub _possible_resolution_list { unless $coll->does('DX::Role::StructuredValue'); my $basic_deps = sub { (depends_on => [ - [ undef ,=> - [ EXISTENCE_OF ,=> $coll, ($_[1]||$_[0])->string_value ], - [ CONTENTS_OF ,=> $_[0] ], - ], - [ $value ,=> - [ CONTENTS_OF ,=> $coll, ($_[1]||$_[0])->string_value ], - [ CONTENTS_OF ,=> $value ], - ], + [ EXISTENCE_OF ,=> $coll, ($_[1]||$_[0])->string_value ], + [ CONTENTS_OF ,=> $_[0] ], + [ CONTENTS_OF ,=> $coll, ($_[1]||$_[0])->string_value ], + [ CONTENTS_OF ,=> $value ], ]) }; if ($value->is_set) { diff --git a/lib/DX/Step/ResolveProposition.pm b/lib/DX/Step/ResolveProposition.pm index 6292ba5..96fdc3a 100644 --- a/lib/DX/Step/ResolveProposition.pm +++ b/lib/DX/Step/ResolveProposition.pm @@ -15,21 +15,16 @@ has actions => (is => 'ro', isa => ArrayRef[Action], required => 1); #has depends_on => (is => 'ro', isa => DependencyGroupList, required => 1); has depends_on => (is => 'ro', required => 1, coerce => sub { - my ($dep_groups) = @_; + my ($deps) = @_; my @exp; - assert_DependencyGroupList $dep_groups; - [ map { - my ($on, @deps) = @$_; - my @exp; - DEP: foreach my $dep (@deps) { - my ($type, @path) = @$dep; - push @exp, [ - $type, - map { ref() ? @{$_->value_path or next DEP} : $_ } @path - ]; - } - (@exp ? [ $on, @exp ] : ()); - } @$dep_groups ]; + DEP: foreach my $dep (@$deps) { + my ($type, @path) = @$dep; + push @exp, [ + $type, + map { ref() ? @{$_->value_path or next DEP} : $_ } @path + ]; + } + \@exp }); has resolves => (is => 'ro', isa => Proposition);