| 1 | package App::RemoteCommand::Pool; | ||||||||||
| 2 | 1 | ▶ | use v5.24; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 3 | 1 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 1 | ▶ | use experimental qw(lexical_subs signatures); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | |||||||||||
| 6 | 0 | ▶ | sub new ($class) { | ||||||||
|
Subroutine
new: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 7 | 0 | bless { | |||||||||
| 8 | pool => [], | ||||||||||
| 9 | }, $class; | ||||||||||
| 10 | } | ||||||||||
| 11 | |||||||||||
| 12 | 0 | ▶ | sub all ($self) { | ||||||||
|
Subroutine
all: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 13 | 0 | $self->{pool}->@*; | |||||||||
| 14 | } | ||||||||||
| 15 | |||||||||||
| 16 | 0 | ▶ | sub add ($self, $ssh) { | ||||||||
|
Subroutine
add: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 17 | 0 | push $self->{pool}->@*, $ssh; | |||||||||
| 18 | 0 | $self; | |||||||||
| 19 | } | ||||||||||
| 20 | |||||||||||
| 21 | 0 | ▶ | sub remove ($self, $ssh) { | ||||||||
|
Subroutine
remove: not called CC=3 SCAR=24.8
Pod
undocumented
| |||||||||||
| 22 | |||||||||||
| 23 | 0 | for my $i (0..$self->{pool}->$#*) { | |||||||||
| 24 | 0 | ▶ | if ($self->{pool}[$i] eq $ssh) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 25 | 0 | return splice $self->{pool}->@*, $i, 1; | |||||||||
| 26 | } | ||||||||||
| 27 | } | ||||||||||
| 28 | 0 | return; | |||||||||
| 29 | } | ||||||||||
| 30 | |||||||||||
| 31 | 0 | ▶ | sub count ($self) { | ||||||||
|
Subroutine
count: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 32 | 0 | scalar $self->{pool}->@*; | |||||||||
| 33 | } | ||||||||||
| 34 | |||||||||||
| 35 | 1 | 1; | |||||||||