Skip to content

Commit

Permalink
Can simplify even further
Browse files Browse the repository at this point in the history
  • Loading branch information
tobyink committed Jun 29, 2022
1 parent cf24bb3 commit f14618c
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions lib/Mite/Attribute.pm
Original file line number Diff line number Diff line change
Expand Up @@ -139,13 +139,7 @@ sub BUILD {

for my $property ( 'builder', 'trigger' ) {
if ( CodeRef->check( $self->$property ) ) {
my $coderef = $self->$property;
my $newname = do {
my $gen = $method_name_generator[$self->is_private]{$property};
local $_ = $self->name;
$gen->( $_ );
};
$self->$property( $newname );
$self->$property( 1 );
}
}

Expand Down

0 comments on commit f14618c

Please sign in to comment.