From: Matt S Trout Date: Sat, 17 Sep 2016 17:43:22 +0000 (+0000) Subject: excise remaining identity_path code X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=7a5595d3819482e2715a029120eb439fa5c6afbd;p=scpubgit%2FDX.git excise remaining identity_path code --- diff --git a/lib/DX/ActionBuilder/BoundValue.pm b/lib/DX/ActionBuilder/BoundValue.pm index 35e4232..a324524 100644 --- a/lib/DX/ActionBuilder/BoundValue.pm +++ b/lib/DX/ActionBuilder/BoundValue.pm @@ -44,8 +44,7 @@ sub action_for_add_member { sub apply_to_value { my ($self, $value, $inner_value) = @_; - my $new_value = $value->but_set_action_builder($self) - ->but_set_identity_path($inner_value->identity_path); + my $new_value = $value->but_set_action_builder($self); return $new_value unless $new_value->isa('DX::Value::Dict'); my %m = %{$new_value->members}; return $new_value->but( diff --git a/lib/DX/ActionBuilder/Normal.pm b/lib/DX/ActionBuilder/Normal.pm index 45e5abd..089c956 100644 --- a/lib/DX/ActionBuilder/Normal.pm +++ b/lib/DX/ActionBuilder/Normal.pm @@ -29,8 +29,7 @@ sub action_for_remove_member { die 'WHUT' } sub apply_to_value { my ($self, $value) = @_; - my $new_value = $value->but_set_action_builder($self) - ->but_set_identity_path($self->target_path); + my $new_value = $value->but_set_action_builder($self); return $new_value unless $new_value->isa('DX::Value::Dict'); my %m = %{$new_value->members}; return $new_value->but( diff --git a/lib/DX/ActionBuilder/Null.pm b/lib/DX/ActionBuilder/Null.pm index b7b2738..1ed847e 100644 --- a/lib/DX/ActionBuilder/Null.pm +++ b/lib/DX/ActionBuilder/Null.pm @@ -33,8 +33,7 @@ sub specialize_for_member { sub apply_to_value { my ($self, $value) = @_; - my $new_value = $value->but_set_action_builder($self) - ->but_set_identity_path($self->target_path); + my $new_value = $value->but_set_action_builder($self); return $new_value unless $new_value->isa('DX::Value::Dict'); my %m = %{$new_value->members}; return $new_value->but( diff --git a/lib/DX/QueryState.pm b/lib/DX/QueryState.pm index ac4039b..9ef30a5 100644 --- a/lib/DX/QueryState.pm +++ b/lib/DX/QueryState.pm @@ -35,7 +35,6 @@ sub new_search_state_for { locals => [ dict( map +($_ => DX::Value::Unset->new( - identity_path => [ 0, $_ ], action_builder => DX::ActionBuilder::UnsetValue->new( target_path => [ 0, $_ ], ) diff --git a/lib/DX/Role/Value.pm b/lib/DX/Role/Value.pm index 018b956..4ff2320 100644 --- a/lib/DX/Role/Value.pm +++ b/lib/DX/Role/Value.pm @@ -3,8 +3,6 @@ package DX::Role::Value; use DX::ActionBuilder::Null; use DX::Role; -has identity_path => (is => 'ro'); - has action_builder => ( is => 'ro', default => 'DX::ActionBuilder::Null', @@ -20,11 +18,6 @@ sub but_set_action_builder { $self->but(action_builder => $ab); } -sub but_set_identity_path { - my ($self, $path) = @_; - $self->but(identity_path => $path); -} - requires 'to_data'; sub equals { diff --git a/lib/DX/Value/Dict.pm b/lib/DX/Value/Dict.pm index 44cc0ab..85decc7 100644 --- a/lib/DX/Value/Dict.pm +++ b/lib/DX/Value/Dict.pm @@ -44,16 +44,4 @@ sub to_data { +{ map +($_ => $m->{$_}->to_data), $self->index_list }; } -sub but_set_identity_path { - my ($self, $path) = @_; - my $m = $self->members; - $self->but( - identity_path => $path, - members => +{ - map +($_ => $m->{$_}->but_set_identity_path([ @$path, $_ ])), - keys %$m - }, - ); -} - 1;