Skip to content

Commit

Permalink
shortcut reduces indent
Browse files Browse the repository at this point in the history
  • Loading branch information
mohawk2 committed Jan 26, 2023
1 parent 45742da commit a785abb
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions lib/PDL/Graphics/Gnuplot.pm
Original file line number Diff line number Diff line change
Expand Up @@ -5708,15 +5708,11 @@ sub _parseOptHash {
} elsif ( 0+@$parser == 1 ) {
# A list ref with a single element - it's a regexp to match
my $a = $parser->[0];
my $p = sub {
$parser = sub {
my ($old, $newparam, $hash) = @_;
if($newparam =~ m/$a/) {
return $newparam;
} else {
barf("Unknown field $newparam (must match m/$a/)\n");
}
barf("Unknown field $newparam (must match m/$a/)\n") if $newparam !~ m/$a/;
return $newparam;
};
$parser = $p;
} else {
# A list ref with multiple elements - they are enums.
# Make a temporary abbrev list for 'em.
Expand Down

0 comments on commit a785abb

Please sign in to comment.