mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-24 23:23:59 -06:00
Code optimization
This commit is contained in:
parent
170d29a789
commit
c98f6734c7
5 changed files with 13 additions and 20 deletions
|
@ -7,15 +7,7 @@ use Slic3r::Geometry qw(A B X Y);
|
|||
sub new {
|
||||
my $class = shift;
|
||||
my $self;
|
||||
if (@_ == 2) {
|
||||
$self = [ @_ ];
|
||||
} elsif (ref $_[0] eq 'ARRAY') {
|
||||
$self = [ $_[0][0], $_[0][1] ];
|
||||
} elsif ($_[0]->isa(__PACKAGE__)) {
|
||||
return $_[0];
|
||||
} else {
|
||||
die "Invalid argument for $class->new";
|
||||
}
|
||||
$self = [ @_ ];
|
||||
bless $self, $class;
|
||||
bless $_, 'Slic3r::Point' for @$self;
|
||||
return $self;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue