mirror of
				https://github.com/SoftFever/OrcaSlicer.git
				synced 2025-11-02 20:51:23 -07:00 
			
		
		
		
	Replaced Moose with Moo => big performance boost and easier packaging
This commit is contained in:
		
							parent
							
								
									bf5824781d
								
							
						
					
					
						commit
						26b05ab155
					
				
					 13 changed files with 67 additions and 75 deletions
				
			
		| 
						 | 
				
			
			@ -1,23 +1,23 @@
 | 
			
		|||
package Slic3r::Polyline;
 | 
			
		||||
use Moose;
 | 
			
		||||
use Moo;
 | 
			
		||||
 | 
			
		||||
has 'lines' => (
 | 
			
		||||
    traits  => ['Array'],
 | 
			
		||||
    is      => 'rw',
 | 
			
		||||
    isa     => 'ArrayRef[Slic3r::Line]',
 | 
			
		||||
    #isa     => 'ArrayRef[Slic3r::Line]',
 | 
			
		||||
    default => sub { [] },
 | 
			
		||||
    handles => {
 | 
			
		||||
        add_line => 'push',
 | 
			
		||||
    },
 | 
			
		||||
);
 | 
			
		||||
 | 
			
		||||
after 'add_line' => sub {
 | 
			
		||||
sub add_line {
 | 
			
		||||
    my $self = shift;
 | 
			
		||||
    my ($line) = @_;
 | 
			
		||||
    
 | 
			
		||||
    push @{ $self->lines }, $line;
 | 
			
		||||
    
 | 
			
		||||
    # add a weak reference to this polyline in line objects
 | 
			
		||||
    # (avoid circular refs)
 | 
			
		||||
    $self->lines->[-1]->polyline($self);
 | 
			
		||||
};
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
sub BUILD {
 | 
			
		||||
    my $self = shift;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue