Skip to content

Commit dfe594d

Browse files
committed
more concise error-check on Axis transforms
1 parent ba66c40 commit dfe594d

1 file changed

Lines changed: 2 additions & 8 deletions

File tree

lib/PDL/Graphics/TriD/Graph.pm

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -300,11 +300,8 @@ sub finish_scale {
300300

301301
sub transform {
302302
my($this,$point,$data,$inds) = @_;
303+
barf "Wrong number of arguments to transform $this\n" if @$inds != 3;
303304
my $i = 0;
304-
if ($#$inds!=2) {
305-
barf("Wrong number of arguments to transform $this\n");
306-
exit;
307-
}
308305
my $pio180 = 0.017453292;
309306
$point->slice("(0)") +=
310307
0.5+($data->slice("($inds->[0])")-$this->{Center}[0]) /
@@ -395,10 +392,7 @@ sub finish_scale {
395392
sub transform {
396393
my($this,$point,$data,$inds) = @_;
397394
my $i = 0;
398-
if ($#$inds!=2) {
399-
barf("Wrong number of arguments to transform $this\n");
400-
exit;
401-
}
395+
barf "Wrong number of arguments to transform $this\n" if @$inds != 3;
402396
my $pio180 = 0.017453292;
403397
$point->slice("(0)") +=
404398
0.5+($data->slice("($inds->[0])")-$this->{Center}[0]) /

0 commit comments

Comments
 (0)